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

Side by Side Diff: ash/shell.cc

Issue 26277006: Created ash::FirstRunHelper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
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 "ash/shell.h" 5 #include "ash/shell.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "ash/accelerators/accelerator_controller.h" 10 #include "ash/accelerators/accelerator_controller.h"
11 #include "ash/accelerators/accelerator_filter.h" 11 #include "ash/accelerators/accelerator_filter.h"
12 #include "ash/accelerators/focus_manager_factory.h" 12 #include "ash/accelerators/focus_manager_factory.h"
13 #include "ash/accelerators/nested_dispatcher_controller.h" 13 #include "ash/accelerators/nested_dispatcher_controller.h"
14 #include "ash/ash_switches.h" 14 #include "ash/ash_switches.h"
15 #include "ash/caps_lock_delegate.h" 15 #include "ash/caps_lock_delegate.h"
16 #include "ash/desktop_background/desktop_background_controller.h" 16 #include "ash/desktop_background/desktop_background_controller.h"
17 #include "ash/desktop_background/desktop_background_view.h" 17 #include "ash/desktop_background/desktop_background_view.h"
18 #include "ash/desktop_background/user_wallpaper_delegate.h" 18 #include "ash/desktop_background/user_wallpaper_delegate.h"
19 #include "ash/display/display_controller.h" 19 #include "ash/display/display_controller.h"
20 #include "ash/display/display_manager.h" 20 #include "ash/display/display_manager.h"
21 #include "ash/display/event_transformation_handler.h" 21 #include "ash/display/event_transformation_handler.h"
22 #include "ash/display/mouse_cursor_event_filter.h" 22 #include "ash/display/mouse_cursor_event_filter.h"
23 #include "ash/display/resolution_notification_controller.h" 23 #include "ash/display/resolution_notification_controller.h"
24 #include "ash/display/screen_position_controller.h" 24 #include "ash/display/screen_position_controller.h"
25 #include "ash/drag_drop/drag_drop_controller.h" 25 #include "ash/drag_drop/drag_drop_controller.h"
26 #include "ash/first_run/first_run_delegate_impl.h"
26 #include "ash/focus_cycler.h" 27 #include "ash/focus_cycler.h"
27 #include "ash/high_contrast/high_contrast_controller.h" 28 #include "ash/high_contrast/high_contrast_controller.h"
28 #include "ash/host/root_window_host_factory.h" 29 #include "ash/host/root_window_host_factory.h"
29 #include "ash/keyboard_uma_event_filter.h" 30 #include "ash/keyboard_uma_event_filter.h"
30 #include "ash/launcher/launcher_delegate.h" 31 #include "ash/launcher/launcher_delegate.h"
31 #include "ash/launcher/launcher_item_delegate.h" 32 #include "ash/launcher/launcher_item_delegate.h"
32 #include "ash/launcher/launcher_item_delegate_manager.h" 33 #include "ash/launcher/launcher_item_delegate_manager.h"
33 #include "ash/launcher/launcher_model.h" 34 #include "ash/launcher/launcher_model.h"
34 #include "ash/magnifier/magnification_controller.h" 35 #include "ash/magnifier/magnification_controller.h"
35 #include "ash/magnifier/partial_magnification_controller.h" 36 #include "ash/magnifier/partial_magnification_controller.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 287
287 bool Shell::GetAppListTargetVisibility() const { 288 bool Shell::GetAppListTargetVisibility() const {
288 return app_list_controller_.get() && 289 return app_list_controller_.get() &&
289 app_list_controller_->GetTargetVisibility(); 290 app_list_controller_->GetTargetVisibility();
290 } 291 }
291 292
292 aura::Window* Shell::GetAppListWindow() { 293 aura::Window* Shell::GetAppListWindow() {
293 return app_list_controller_.get() ? app_list_controller_->GetWindow() : NULL; 294 return app_list_controller_.get() ? app_list_controller_->GetWindow() : NULL;
294 } 295 }
295 296
297 app_list::AppListView* Shell::GetAppListView() {
298 return app_list_controller_.get() ? app_list_controller_->GetView() : NULL;
299 }
300
296 bool Shell::IsSystemModalWindowOpen() const { 301 bool Shell::IsSystemModalWindowOpen() const {
297 if (simulate_modal_window_open_for_testing_) 302 if (simulate_modal_window_open_for_testing_)
298 return true; 303 return true;
299 const std::vector<aura::Window*> containers = GetContainersFromAllRootWindows( 304 const std::vector<aura::Window*> containers = GetContainersFromAllRootWindows(
300 internal::kShellWindowId_SystemModalContainer, NULL); 305 internal::kShellWindowId_SystemModalContainer, NULL);
301 for (std::vector<aura::Window*>::const_iterator cit = containers.begin(); 306 for (std::vector<aura::Window*>::const_iterator cit = containers.begin();
302 cit != containers.end(); ++cit) { 307 cit != containers.end(); ++cit) {
303 for (aura::Window::Windows::const_iterator wit = (*cit)->children().begin(); 308 for (aura::Window::Windows::const_iterator wit = (*cit)->children().begin();
304 wit != (*cit)->children().end(); ++wit) { 309 wit != (*cit)->children().end(); ++wit) {
305 if ((*wit)->GetProperty(aura::client::kModalKey) == 310 if ((*wit)->GetProperty(aura::client::kModalKey) ==
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 502
498 void Shell::SetTouchHudProjectionEnabled(bool enabled) { 503 void Shell::SetTouchHudProjectionEnabled(bool enabled) {
499 if (is_touch_hud_projection_enabled_ == enabled) 504 if (is_touch_hud_projection_enabled_ == enabled)
500 return; 505 return;
501 506
502 is_touch_hud_projection_enabled_ = enabled; 507 is_touch_hud_projection_enabled_ = enabled;
503 FOR_EACH_OBSERVER(ShellObserver, observers_, 508 FOR_EACH_OBSERVER(ShellObserver, observers_,
504 OnTouchHudProjectionToggled(enabled)); 509 OnTouchHudProjectionToggled(enabled));
505 } 510 }
506 511
512 #if defined(OS_CHROMEOS)
513 ash::FirstRunDelegate* Shell::CreateFirstRunDelegate() {
514 return new ash::FirstRunDelegateImpl;
515 }
516 #endif // defined(OS_CHROMEOS)
517
507 void Shell::InitRootWindowForSecondaryDisplay(aura::RootWindow* root) { 518 void Shell::InitRootWindowForSecondaryDisplay(aura::RootWindow* root) {
508 internal::RootWindowController* controller = 519 internal::RootWindowController* controller =
509 new internal::RootWindowController(root); 520 new internal::RootWindowController(root);
510 // Pass false for the |is_first_run_after_boot| parameter so we'll show a 521 // Pass false for the |is_first_run_after_boot| parameter so we'll show a
511 // black background on this display instead of trying to mimic the boot splash 522 // black background on this display instead of trying to mimic the boot splash
512 // screen. 523 // screen.
513 InitRootWindowController(controller, false); 524 InitRootWindowController(controller, false);
514 525
515 controller->root_window_layout()->OnWindowResized(); 526 controller->root_window_layout()->OnWindowResized();
516 desktop_background_controller_->OnRootWindowAdded(root); 527 desktop_background_controller_->OnRootWindowAdded(root);
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 //////////////////////////////////////////////////////////////////////////////// 991 ////////////////////////////////////////////////////////////////////////////////
981 // Shell, aura::client::ActivationChangeObserver implementation: 992 // Shell, aura::client::ActivationChangeObserver implementation:
982 993
983 void Shell::OnWindowActivated(aura::Window* gained_active, 994 void Shell::OnWindowActivated(aura::Window* gained_active,
984 aura::Window* lost_active) { 995 aura::Window* lost_active) {
985 if (gained_active) 996 if (gained_active)
986 target_root_window_ = gained_active->GetRootWindow(); 997 target_root_window_ = gained_active->GetRootWindow();
987 } 998 }
988 999
989 } // namespace ash 1000 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698