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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 204 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
205 | 205 |
206 if (chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH && | 206 if (chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH && |
207 !url.SchemeIsHTTPOrHTTPS()) | 207 !url.SchemeIsHTTPOrHTTPS()) |
208 chrome::ActivateDesktopHelper(chrome::ASH_KEEP_RUNNING); | 208 chrome::ActivateDesktopHelper(chrome::ASH_KEEP_RUNNING); |
209 | 209 |
210 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 210 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
211 base::Bind(&OpenExternalOnFileThread, url)); | 211 base::Bind(&OpenExternalOnFileThread, url)); |
212 } | 212 } |
213 | 213 |
214 #if !defined(USE_AURA) | |
215 gfx::NativeWindow GetTopLevel(gfx::NativeView view) { | |
216 return ::GetAncestor(view, GA_ROOT); | |
217 } | |
218 | |
219 gfx::NativeView GetParent(gfx::NativeView view) { | |
220 return ::GetParent(view); | |
221 } | |
222 | |
223 bool IsWindowActive(gfx::NativeWindow window) { | |
224 return ::GetForegroundWindow() == window; | |
225 } | |
226 | |
227 void ActivateWindow(gfx::NativeWindow window) { | |
228 ::SetForegroundWindow(window); | |
229 } | |
230 | |
231 bool IsVisible(gfx::NativeView view) { | |
232 // MSVC complains if we don't include != 0. | |
233 return ::IsWindowVisible(view) != 0; | |
234 } | |
235 #endif | |
236 | |
237 } // namespace platform_util | 214 } // namespace platform_util |
OLD | NEW |