| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/base/win/shell.h" | 5 #include "ui/base/win/shell.h" |
| 6 | 6 |
| 7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
| 8 #include <shellapi.h> | 8 #include <shellapi.h> |
| 9 #include <shlobj.h> // Must be before propkey. | 9 #include <shlobj.h> // Must be before propkey. |
| 10 #include <propkey.h> | 10 #include <propkey.h> |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 if (!args.empty()) | 79 if (!args.empty()) |
| 80 sei.lpParameters = args.c_str(); | 80 sei.lpParameters = args.c_str(); |
| 81 | 81 |
| 82 if (::ShellExecuteExW(&sei)) | 82 if (::ShellExecuteExW(&sei)) |
| 83 return true; | 83 return true; |
| 84 if (::GetLastError() == ERROR_NO_ASSOCIATION) | 84 if (::GetLastError() == ERROR_NO_ASSOCIATION) |
| 85 return OpenItemWithExternalApp(full_path); | 85 return OpenItemWithExternalApp(full_path); |
| 86 return false; | 86 return false; |
| 87 } | 87 } |
| 88 | 88 |
| 89 bool OpenItemViaShell(const FilePath& full_path) { | 89 bool OpenItemViaShell(const base::FilePath& full_path) { |
| 90 return OpenAnyViaShell(full_path.value(), full_path.DirName().value(), | 90 return OpenAnyViaShell(full_path.value(), full_path.DirName().value(), |
| 91 string16(), 0); | 91 string16(), 0); |
| 92 } | 92 } |
| 93 | 93 |
| 94 bool OpenItemViaShellNoZoneCheck(const FilePath& full_path) { | 94 bool OpenItemViaShellNoZoneCheck(const base::FilePath& full_path) { |
| 95 return OpenAnyViaShell(full_path.value(), string16(), string16(), | 95 return OpenAnyViaShell(full_path.value(), string16(), string16(), |
| 96 SEE_MASK_NOZONECHECKS | SEE_MASK_FLAG_DDEWAIT); | 96 SEE_MASK_NOZONECHECKS | SEE_MASK_FLAG_DDEWAIT); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void SetAppIdForWindow(const string16& app_id, HWND hwnd) { | 99 void SetAppIdForWindow(const string16& app_id, HWND hwnd) { |
| 100 SetAppDetailsForWindow(app_id, string16(), string16(), string16(), hwnd); | 100 SetAppDetailsForWindow(app_id, string16(), string16(), string16(), hwnd); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void SetAppIconForWindow(const string16& app_icon, HWND hwnd) { | 103 void SetAppIconForWindow(const string16& app_icon, HWND hwnd) { |
| 104 SetAppDetailsForWindow(string16(), app_icon, string16(), string16(), hwnd); | 104 SetAppDetailsForWindow(string16(), app_icon, string16(), string16(), hwnd); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 117 bool IsAeroGlassEnabled() { | 117 bool IsAeroGlassEnabled() { |
| 118 if (base::win::GetVersion() < base::win::VERSION_VISTA) | 118 if (base::win::GetVersion() < base::win::VERSION_VISTA) |
| 119 return false; | 119 return false; |
| 120 // If composition is not enabled, we behave like on XP. | 120 // If composition is not enabled, we behave like on XP. |
| 121 BOOL enabled = FALSE; | 121 BOOL enabled = FALSE; |
| 122 return SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled; | 122 return SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled; |
| 123 } | 123 } |
| 124 | 124 |
| 125 } // namespace win | 125 } // namespace win |
| 126 } // namespace ui | 126 } // namespace ui |
| OLD | NEW |