Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: chrome/browser/ui/ash/ash_util.cc

Issue 10967043: Add ability to open/close ash desktop via hot dogs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ToT Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/ash/ash_util.h ('k') | chrome/browser/ui/browser_command_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/ui/ash/ash_util.h" 5 #include "chrome/browser/ui/ash/ash_util.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "chrome/browser/ui/ash/ash_init.h"
8 #include "ui/aura/root_window.h" 9 #include "ui/aura/root_window.h"
9 10
10 namespace chrome { 11 namespace chrome {
11 12
12 bool IsNativeViewInAsh(gfx::NativeView native_view) { 13 bool IsNativeViewInAsh(gfx::NativeView native_view) {
13 #if defined(OS_CHROMEOS) 14 #if defined(OS_CHROMEOS)
14 // Optimization. There is only ash on ChromeOS. 15 // Optimization. There is only ash on ChromeOS.
15 return true; 16 return true;
16 #endif 17 #endif
17 18
18 if (!ash::Shell::HasInstance()) 19 if (!ash::Shell::HasInstance())
19 return false; 20 return false;
20 21
21 ash::Shell::RootWindowList root_windows = 22 ash::Shell::RootWindowList root_windows =
22 ash::Shell::GetInstance()->GetAllRootWindows(); 23 ash::Shell::GetInstance()->GetAllRootWindows();
23 24
24 for (ash::Shell::RootWindowList::const_iterator it = root_windows.begin(); 25 for (ash::Shell::RootWindowList::const_iterator it = root_windows.begin();
25 it != root_windows.end(); ++it) { 26 it != root_windows.end(); ++it) {
26 if ((*it)->Contains(native_view)) 27 if ((*it)->Contains(native_view))
27 return true; 28 return true;
28 } 29 }
29 30
30 return false; 31 return false;
31 } 32 }
32 33
33 bool IsNativeWindowInAsh(gfx::NativeWindow native_window) { 34 bool IsNativeWindowInAsh(gfx::NativeWindow native_window) {
34 return IsNativeViewInAsh(native_window); 35 return IsNativeViewInAsh(native_window);
35 } 36 }
36 37
38 void ToggleAshDesktop() {
39 if (!ash::Shell::HasInstance())
40 OpenAsh();
41 else
42 CloseAsh();
43 }
44
37 } // namespace chrome 45 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/ash_util.h ('k') | chrome/browser/ui/browser_command_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698