blob: 364b7a32712897fce09b2ab34bbd4394e5cfab0f [file] [log] [blame]
Torne (Richard Coles)58218062012-11-14 11:43:16 +00001// 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
Torne (Richard Coles)7d4cd472013-06-19 11:58:07 +010010#include "base/strings/string16.h"
Torne (Richard Coles)58218062012-11-14 11:43:16 +000011#include "ui/base/ui_export.h"
12
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000013namespace base {
Torne (Richard Coles)58218062012-11-14 11:43:16 +000014class FilePath;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000015}
Torne (Richard Coles)58218062012-11-14 11:43:16 +000016
17namespace ui {
18namespace 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.
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000023UI_EXPORT bool OpenItemViaShell(const base::FilePath& full_path);
Torne (Richard Coles)58218062012-11-14 11:43:16 +000024
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.
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000028UI_EXPORT bool OpenItemViaShellNoZoneCheck(const base::FilePath& full_path);
Torne (Richard Coles)58218062012-11-14 11:43:16 +000029
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.
34UI_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.
42bool 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.
47UI_EXPORT void SetAppIdForWindow(const string16& app_id, HWND hwnd);
48
49// Sets the application icon for the window specified.
50UI_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.
55UI_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.
61UI_EXPORT bool IsAeroGlassEnabled();
62
63} // namespace win
64} // namespace ui
65
66#endif // UI_BASE_WIN_SHELL_H_