OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 "chrome/browser/platform_util.h" | 5 #include "chrome/browser/platform_util.h" |
6 | 6 |
7 #include <commdlg.h> | 7 #include <commdlg.h> |
8 #include <dwmapi.h> | 8 #include <dwmapi.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #include <shlobj.h> | 10 #include <shlobj.h> |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 namespace platform_util { | 118 namespace platform_util { |
119 | 119 |
120 void ShowItemInFolder(const FilePath& full_path) { | 120 void ShowItemInFolder(const FilePath& full_path) { |
121 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 121 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
122 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 122 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
123 base::Bind(&ShowItemInFolderOnFileThread, full_path)); | 123 base::Bind(&ShowItemInFolderOnFileThread, full_path)); |
124 } | 124 } |
125 | 125 |
126 void OpenItem(const FilePath& full_path) { | 126 void OpenItem(const FilePath& full_path) { |
127 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 127 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
128 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 128 BrowserThread::PostTask( |
129 base::IgnoreReturn<bool>(base::Bind(&ui::win::OpenItemViaShell, | 129 BrowserThread::FILE, FROM_HERE, |
130 full_path))); | 130 base::Bind(base::IgnoreResult(&ui::win::OpenItemViaShell), full_path)); |
131 } | 131 } |
132 | 132 |
133 void OpenExternal(const GURL& url) { | 133 void OpenExternal(const GURL& url) { |
134 // Quote the input scheme to be sure that the command does not have | 134 // Quote the input scheme to be sure that the command does not have |
135 // parameters unexpected by the external program. This url should already | 135 // parameters unexpected by the external program. This url should already |
136 // have been escaped. | 136 // have been escaped. |
137 std::string escaped_url = url.spec(); | 137 std::string escaped_url = url.spec(); |
138 escaped_url.insert(0, "\""); | 138 escaped_url.insert(0, "\""); |
139 escaped_url += "\""; | 139 escaped_url += "\""; |
140 | 140 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 ::SetForegroundWindow(window); | 191 ::SetForegroundWindow(window); |
192 } | 192 } |
193 | 193 |
194 bool IsVisible(gfx::NativeView view) { | 194 bool IsVisible(gfx::NativeView view) { |
195 // MSVC complains if we don't include != 0. | 195 // MSVC complains if we don't include != 0. |
196 return ::IsWindowVisible(view) != 0; | 196 return ::IsWindowVisible(view) != 0; |
197 } | 197 } |
198 #endif | 198 #endif |
199 | 199 |
200 } // namespace platform_util | 200 } // namespace platform_util |
OLD | NEW |