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

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

Issue 643103003: Use app_list_service_disabled in Athena (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
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 "chrome/browser/ui/ash/ash_init.h"
9 #include "chrome/browser/ui/host_desktop.h" 9 #include "chrome/browser/ui/host_desktop.h"
10 #include "ui/aura/window_event_dispatcher.h" 10 #include "ui/aura/window_event_dispatcher.h"
11 11
12 #if !defined(OS_CHROMEOS)
13 #include "base/command_line.h"
14 #include "chrome/common/chrome_switches.h"
15 #endif
16
12 namespace chrome { 17 namespace chrome {
13 18
19 bool ShouldOpenAshOnStartup() {
20 #if defined(OS_CHROMEOS)
21 return true;
22 #else
23 // TODO(scottmg): http://crbug.com/133312, will need this for Win8 too.
24 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kOpenAsh);
25 #endif
26 }
27
14 bool IsNativeViewInAsh(gfx::NativeView native_view) { 28 bool IsNativeViewInAsh(gfx::NativeView native_view) {
15 #if defined(OS_CHROMEOS) 29 #if defined(OS_CHROMEOS)
16 // Optimization. There is only ash or only athena on ChromeOS. 30 // Optimization. There is only ash or only athena on ChromeOS.
17 return ash::Shell::HasInstance(); 31 return ash::Shell::HasInstance();
18 #endif 32 #endif
19 33
20 if (!ash::Shell::HasInstance()) 34 if (!ash::Shell::HasInstance())
21 return false; 35 return false;
22 36
23 aura::Window::Windows root_windows = 37 aura::Window::Windows root_windows =
24 ash::Shell::GetInstance()->GetAllRootWindows(); 38 ash::Shell::GetInstance()->GetAllRootWindows();
25 39
26 for (aura::Window::Windows::const_iterator it = root_windows.begin(); 40 for (aura::Window::Windows::const_iterator it = root_windows.begin();
27 it != root_windows.end(); ++it) { 41 it != root_windows.end(); ++it) {
28 if ((*it)->Contains(native_view)) 42 if ((*it)->Contains(native_view))
29 return true; 43 return true;
30 } 44 }
31 45
32 return false; 46 return false;
33 } 47 }
34 48
35 bool IsNativeWindowInAsh(gfx::NativeWindow native_window) { 49 bool IsNativeWindowInAsh(gfx::NativeWindow native_window) {
36 return IsNativeViewInAsh(native_window); 50 return IsNativeViewInAsh(native_window);
37 } 51 }
38 52
39 } // namespace chrome 53 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/ash_util.h ('k') | chrome/browser/ui/aura/chrome_browser_main_extra_parts_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698