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

Side by Side Diff: ash/shell.cc

Issue 22429004: Refactor LauncherDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add some comments Created 7 years, 4 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 "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/focus_manager_factory.h" 10 #include "ash/accelerators/focus_manager_factory.h"
11 #include "ash/ash_switches.h" 11 #include "ash/ash_switches.h"
12 #include "ash/caps_lock_delegate.h" 12 #include "ash/caps_lock_delegate.h"
13 #include "ash/desktop_background/desktop_background_controller.h" 13 #include "ash/desktop_background/desktop_background_controller.h"
14 #include "ash/desktop_background/desktop_background_view.h" 14 #include "ash/desktop_background/desktop_background_view.h"
15 #include "ash/desktop_background/user_wallpaper_delegate.h" 15 #include "ash/desktop_background/user_wallpaper_delegate.h"
16 #include "ash/display/display_controller.h" 16 #include "ash/display/display_controller.h"
17 #include "ash/display/display_manager.h" 17 #include "ash/display/display_manager.h"
18 #include "ash/display/event_transformation_handler.h" 18 #include "ash/display/event_transformation_handler.h"
19 #include "ash/display/mouse_cursor_event_filter.h" 19 #include "ash/display/mouse_cursor_event_filter.h"
20 #include "ash/display/screen_position_controller.h" 20 #include "ash/display/screen_position_controller.h"
21 #include "ash/drag_drop/drag_drop_controller.h" 21 #include "ash/drag_drop/drag_drop_controller.h"
22 #include "ash/focus_cycler.h" 22 #include "ash/focus_cycler.h"
23 #include "ash/high_contrast/high_contrast_controller.h" 23 #include "ash/high_contrast/high_contrast_controller.h"
24 #include "ash/host/root_window_host_factory.h" 24 #include "ash/host/root_window_host_factory.h"
25 #include "ash/launcher/launcher_delegate.h" 25 #include "ash/launcher/launcher_delegate_proxy.h"
26 #include "ash/launcher/launcher_model.h" 26 #include "ash/launcher/launcher_model.h"
27 #include "ash/magnifier/magnification_controller.h" 27 #include "ash/magnifier/magnification_controller.h"
28 #include "ash/magnifier/partial_magnification_controller.h" 28 #include "ash/magnifier/partial_magnification_controller.h"
29 #include "ash/root_window_controller.h" 29 #include "ash/root_window_controller.h"
30 #include "ash/screen_ash.h" 30 #include "ash/screen_ash.h"
31 #include "ash/session_state_delegate.h" 31 #include "ash/session_state_delegate.h"
32 #include "ash/shelf/shelf_layout_manager.h" 32 #include "ash/shelf/shelf_layout_manager.h"
33 #include "ash/shelf/shelf_widget.h" 33 #include "ash/shelf/shelf_widget.h"
34 #include "ash/shell_delegate.h" 34 #include "ash/shell_delegate.h"
35 #include "ash/shell_factory.h" 35 #include "ash/shell_factory.h"
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 843
844 bool Shell::HasPrimaryStatusArea() { 844 bool Shell::HasPrimaryStatusArea() {
845 ShelfWidget* shelf = GetPrimaryRootWindowController()->shelf(); 845 ShelfWidget* shelf = GetPrimaryRootWindowController()->shelf();
846 return shelf && shelf->status_area_widget(); 846 return shelf && shelf->status_area_widget();
847 } 847 }
848 848
849 SystemTray* Shell::GetPrimarySystemTray() { 849 SystemTray* Shell::GetPrimarySystemTray() {
850 return GetPrimaryRootWindowController()->GetSystemTray(); 850 return GetPrimaryRootWindowController()->GetSystemTray();
851 } 851 }
852 852
853 LauncherDelegate* Shell::GetLauncherDelegate() { 853 LauncherDelegate* Shell::GetLauncherDelegate() {
Mr4D (OOO till 08-26) 2013/08/13 18:18:24 Somehow I need to think about this for a while. Di
simonhong_ 2013/08/13 19:54:56 sky didn't tell specific implementation details fo
854 if (!launcher_delegate_) { 854 if (!launcher_delegate_) {
855 DCHECK(!launcher_model_);
Mr4D (OOO till 08-26) 2013/08/13 18:18:24 I assume you mean "!launcher_model_.get()" ?
simonhong_ 2013/08/13 19:54:56 Done. But, I think DCHECK(!launcher_delegate_) als
855 launcher_model_.reset(new LauncherModel); 856 launcher_model_.reset(new LauncherModel);
856 launcher_delegate_.reset( 857 launcher_delegate_.reset(new internal::LauncherDelegateProxy);
857 delegate_->CreateLauncherDelegate(launcher_model_.get()));
858 } 858 }
859 return launcher_delegate_.get(); 859 return launcher_delegate_.get();
860 } 860 }
861 861
862 void Shell::SetTouchHudProjectionEnabled(bool enabled) { 862 void Shell::SetTouchHudProjectionEnabled(bool enabled) {
863 if (is_touch_hud_projection_enabled_ == enabled) 863 if (is_touch_hud_projection_enabled_ == enabled)
864 return; 864 return;
865 865
866 is_touch_hud_projection_enabled_ = enabled; 866 is_touch_hud_projection_enabled_ = enabled;
867 FOR_EACH_OBSERVER(ShellObserver, observers_, 867 FOR_EACH_OBSERVER(ShellObserver, observers_,
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 //////////////////////////////////////////////////////////////////////////////// 966 ////////////////////////////////////////////////////////////////////////////////
967 // Shell, aura::client::ActivationChangeObserver implementation: 967 // Shell, aura::client::ActivationChangeObserver implementation:
968 968
969 void Shell::OnWindowActivated(aura::Window* gained_active, 969 void Shell::OnWindowActivated(aura::Window* gained_active,
970 aura::Window* lost_active) { 970 aura::Window* lost_active) {
971 if (gained_active) 971 if (gained_active)
972 target_root_window_ = gained_active->GetRootWindow(); 972 target_root_window_ = gained_active->GetRootWindow();
973 } 973 }
974 974
975 } // namespace ash 975 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698