• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 
5 #ifndef UI_BASE_WIN_SHELL_H_
6 #define UI_BASE_WIN_SHELL_H_
7 
8 #include <windows.h>
9 
10 #include "base/strings/string16.h"
11 #include "ui/base/ui_export.h"
12 
13 namespace base {
14 class FilePath;
15 }
16 
17 namespace ui {
18 namespace win {
19 
20 // Open or run a file via the Windows shell. In the event that there is no
21 // default application registered for the file specified by 'full_path',
22 // ask the user, via the Windows "Open With" dialog.
23 // Returns 'true' on successful open, 'false' otherwise.
24 UI_EXPORT bool OpenItemViaShell(const base::FilePath& full_path);
25 
26 // The download manager now writes the alternate data stream with the
27 // zone on all downloads. This function is equivalent to OpenItemViaShell
28 // without showing the zone warning dialog.
29 UI_EXPORT bool OpenItemViaShellNoZoneCheck(const base::FilePath& full_path);
30 
31 // Lower level function that allows opening of non-files like urls or GUIDs
32 // don't use it if one of the above will do. |mask| is a valid combination
33 // of SEE_MASK_FLAG_XXX as stated in msdn. If there is no default application
34 // registered for the item, it behaves the same as OpenItemViaShell.
35 UI_EXPORT bool OpenAnyViaShell(const string16& full_path,
36                                const string16& directory,
37                                const string16& args,
38                                DWORD mask);
39 
40 // Ask the user, via the Windows "Open With" dialog, for an application to use
41 // to open the file specified by 'full_path'.
42 // Returns 'true' on successful open, 'false' otherwise.
43 bool OpenItemWithExternalApp(const string16& full_path);
44 
45 // Disables the ability of the specified window to be pinned to the taskbar or
46 // the Start menu. This will remove "Pin this program to taskbar" from the
47 // taskbar menu of the specified window.
48 UI_EXPORT bool PreventWindowFromPinning(HWND hwnd);
49 
50 // Sets the application id, app icon, relaunch command and relaunch display name
51 // for the given window.
52 UI_EXPORT void SetAppDetailsForWindow(const string16& app_id,
53                                       const string16& app_icon,
54                                       const string16& relaunch_command,
55                                       const string16& relaunch_display_name,
56                                       HWND hwnd);
57 
58 // Sets the application id given as the Application Model ID for the window
59 // specified.  This method is used to insure that different web applications
60 // do not group together on the Win7 task bar.
61 UI_EXPORT void SetAppIdForWindow(const string16& app_id, HWND hwnd);
62 
63 // Sets the application icon for the window specified.
64 UI_EXPORT void SetAppIconForWindow(const string16& app_icon, HWND hwnd);
65 
66 // Sets the relaunch command and relaunch display name for the window specified.
67 // Windows will use this information for grouping on the taskbar, and to create
68 // a shortcut if the window is pinned to the taskbar.
69 UI_EXPORT void SetRelaunchDetailsForWindow(const string16& relaunch_command,
70                                            const string16& display_name,
71                                            HWND hwnd);
72 
73 // Returns true if composition is available and turned on on the current
74 // platform.
75 UI_EXPORT bool IsAeroGlassEnabled();
76 
77 }  // namespace win
78 }  // namespace ui
79 
80 #endif  // UI_BASE_WIN_SHELL_H_
81