Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / ui / base / win / shell.h
blob4031de6d9aec479411001681081c928964e61624
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_BASE_WIN_SHELL_H_
6 #define UI_BASE_WIN_SHELL_H_
8 #include <windows.h>
10 #include "base/strings/string16.h"
11 #include "ui/base/ui_base_export.h"
13 namespace base {
14 class FilePath;
17 namespace ui {
18 namespace win {
20 // Open the folder at |full_path| via the Windows shell. Does nothing if
21 // |full_path| is not a folder.
23 // Note: Must be called on a thread that allows blocking.
24 UI_BASE_EXPORT bool OpenFolderViaShell(const base::FilePath& full_path);
26 // Invokes the default verb on the file specified by |full_path| via the Windows
27 // shell. Usually, the default verb is "open" unless specified otherwise for the
28 // file type.
30 // In the event that there is no default application registered for the
31 // specified file, asks the user via the Windows "Open With" dialog. Returns
32 // |true| on success.
34 // Note: Must be called on a thread that allows blocking.
35 UI_BASE_EXPORT bool OpenFileViaShell(const base::FilePath& full_path);
37 // Lower level function that allows opening of non-files like urls or GUIDs
38 // don't use it if one of the above will do. |mask| is a valid combination
39 // of SEE_MASK_XXX as stated in MSDN. If there is no default application
40 // registered for the item, it behaves the same as OpenFileViaShell.
42 // Note: Must be called on a thread that allows blocking.
43 UI_BASE_EXPORT bool OpenAnyViaShell(const base::string16& full_path,
44 const base::string16& directory,
45 const base::string16& args,
46 DWORD mask);
48 // Disables the ability of the specified window to be pinned to the taskbar or
49 // the Start menu. This will remove "Pin this program to taskbar" from the
50 // taskbar menu of the specified window.
51 UI_BASE_EXPORT bool PreventWindowFromPinning(HWND hwnd);
53 // Sets the application id, app icon, relaunch command and relaunch display name
54 // for the given window.
55 UI_BASE_EXPORT void SetAppDetailsForWindow(
56 const base::string16& app_id,
57 const base::string16& app_icon,
58 const base::string16& relaunch_command,
59 const base::string16& relaunch_display_name,
60 HWND hwnd);
62 // Sets the application id given as the Application Model ID for the window
63 // specified. This method is used to insure that different web applications
64 // do not group together on the Win7 task bar.
65 UI_BASE_EXPORT void SetAppIdForWindow(const base::string16& app_id, HWND hwnd);
67 // Sets the application icon for the window specified.
68 UI_BASE_EXPORT void SetAppIconForWindow(const base::string16& app_icon,
69 HWND hwnd);
71 // Sets the relaunch command and relaunch display name for the window specified.
72 // Windows will use this information for grouping on the taskbar, and to create
73 // a shortcut if the window is pinned to the taskbar.
74 UI_BASE_EXPORT void SetRelaunchDetailsForWindow(
75 const base::string16& relaunch_command,
76 const base::string16& display_name,
77 HWND hwnd);
79 // Returns true if composition is available and turned on on the current
80 // platform.
81 UI_BASE_EXPORT bool IsAeroGlassEnabled();
83 } // namespace win
84 } // namespace ui
86 #endif // UI_BASE_WIN_SHELL_H_