Home | History | Annotate | Download | only in win
      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 // Open or run a file via the Windows shell. In the event that there is no
     20 // default application registered for the file specified by 'full_path',
     21 // ask the user, via the Windows "Open With" dialog.
     22 // Returns 'true' on successful open, 'false' otherwise.
     23 UI_EXPORT bool OpenItemViaShell(const base::FilePath& full_path);
     24 
     25 // The download manager now writes the alternate data stream with the
     26 // zone on all downloads. This function is equivalent to OpenItemViaShell
     27 // without showing the zone warning dialog.
     28 UI_EXPORT bool OpenItemViaShellNoZoneCheck(const base::FilePath& full_path);
     29 
     30 // Lower level function that allows opening of non-files like urls or GUIDs
     31 // don't use it if one of the above will do. |mask| is a valid combination
     32 // of SEE_MASK_FLAG_XXX as stated in msdn. If there is no default application
     33 // registered for the item, it behaves the same as OpenItemViaShell.
     34 UI_EXPORT bool OpenAnyViaShell(const string16& full_path,
     35                                const string16& directory,
     36                                const string16& args,
     37                                DWORD mask);
     38 
     39 // Ask the user, via the Windows "Open With" dialog, for an application to use
     40 // to open the file specified by 'full_path'.
     41 // Returns 'true' on successful open, 'false' otherwise.
     42 bool OpenItemWithExternalApp(const string16& full_path);
     43 
     44 // Sets the application id given as the Application Model ID for the window
     45 // specified.  This method is used to insure that different web applications
     46 // do not group together on the Win7 task bar.
     47 UI_EXPORT void SetAppIdForWindow(const string16& app_id, HWND hwnd);
     48 
     49 // Sets the application icon for the window specified.
     50 UI_EXPORT void SetAppIconForWindow(const string16& app_icon, HWND hwnd);
     51 
     52 // Sets the relaunch command and relaunch display name for the window specified.
     53 // Windows will use this information for grouping on the taskbar, and to create
     54 // a shortcut if the window is pinned to the taskbar.
     55 UI_EXPORT void SetRelaunchDetailsForWindow(const string16& relaunch_command,
     56                                            const string16& display_name,
     57                                            HWND hwnd);
     58 
     59 // Returns true if composition is available and turned on on the current
     60 // platform.
     61 UI_EXPORT bool IsAeroGlassEnabled();
     62 
     63 }  // namespace win
     64 }  // namespace ui
     65 
     66 #endif  // UI_BASE_WIN_SHELL_H_
     67