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

Side by Side Diff: ash/shell.cc

Issue 11092034: Add Wallpaper option to launcher context menu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup 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
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_stub.h" 12 #include "ash/caps_lock_delegate_stub.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_resources.h" 14 #include "ash/desktop_background/desktop_background_resources.h"
15 #include "ash/desktop_background/desktop_background_view.h" 15 #include "ash/desktop_background/desktop_background_view.h"
16 #include "ash/display/display_controller.h" 16 #include "ash/display/display_controller.h"
17 #include "ash/display/mouse_cursor_event_filter.h" 17 #include "ash/display/mouse_cursor_event_filter.h"
18 #include "ash/display/multi_display_manager.h" 18 #include "ash/display/multi_display_manager.h"
19 #include "ash/display/screen_position_controller.h" 19 #include "ash/display/screen_position_controller.h"
20 #include "ash/display/secondary_display_view.h" 20 #include "ash/display/secondary_display_view.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/launcher/launcher.h" 24 #include "ash/launcher/launcher.h"
25 #include "ash/magnifier/magnification_controller.h" 25 #include "ash/magnifier/magnification_controller.h"
26 #include "ash/root_window_controller.h" 26 #include "ash/root_window_controller.h"
27 #include "ash/screen_ash.h" 27 #include "ash/screen_ash.h"
28 #include "ash/shell_context_menu.h"
29 #include "ash/shell_delegate.h" 28 #include "ash/shell_delegate.h"
30 #include "ash/shell_factory.h" 29 #include "ash/shell_factory.h"
31 #include "ash/shell_window_ids.h" 30 #include "ash/shell_window_ids.h"
32 #include "ash/system/status_area_widget.h" 31 #include "ash/system/status_area_widget.h"
33 #include "ash/system/tray/system_tray.h" 32 #include "ash/system/tray/system_tray.h"
34 #include "ash/tooltips/tooltip_controller.h" 33 #include "ash/tooltips/tooltip_controller.h"
35 #include "ash/touch/touch_observer_hud.h" 34 #include "ash/touch/touch_observer_hud.h"
36 #include "ash/wm/activation_controller.h" 35 #include "ash/wm/activation_controller.h"
37 #include "ash/wm/always_on_top_controller.h" 36 #include "ash/wm/always_on_top_controller.h"
38 #include "ash/wm/app_list_controller.h" 37 #include "ash/wm/app_list_controller.h"
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 aura::RootWindow* root_window = display_controller_->GetPrimaryRootWindow(); 375 aura::RootWindow* root_window = display_controller_->GetPrimaryRootWindow();
377 active_root_window_ = root_window; 376 active_root_window_ = root_window;
378 377
379 cursor_manager_.SetDeviceScaleFactor( 378 cursor_manager_.SetDeviceScaleFactor(
380 root_window->AsRootWindowHostDelegate()->GetDeviceScaleFactor()); 379 root_window->AsRootWindowHostDelegate()->GetDeviceScaleFactor());
381 380
382 #if !defined(OS_MACOSX) 381 #if !defined(OS_MACOSX)
383 nested_dispatcher_controller_.reset(new NestedDispatcherController); 382 nested_dispatcher_controller_.reset(new NestedDispatcherController);
384 accelerator_controller_.reset(new AcceleratorController); 383 accelerator_controller_.reset(new AcceleratorController);
385 #endif 384 #endif
386 shell_context_menu_.reset(new internal::ShellContextMenu);
387 385
388 // The order in which event filters are added is significant. 386 // The order in which event filters are added is significant.
389 user_activity_detector_.reset(new UserActivityDetector); 387 user_activity_detector_.reset(new UserActivityDetector);
390 AddEnvEventFilter(user_activity_detector_.get()); 388 AddEnvEventFilter(user_activity_detector_.get());
391 389
392 event_rewriter_filter_.reset(new internal::EventRewriterEventFilter); 390 event_rewriter_filter_.reset(new internal::EventRewriterEventFilter);
393 AddEnvEventFilter(event_rewriter_filter_.get()); 391 AddEnvEventFilter(event_rewriter_filter_.get());
394 392
395 overlay_filter_.reset(new internal::OverlayEventFilter); 393 overlay_filter_.reset(new internal::OverlayEventFilter);
396 AddEnvEventFilter(overlay_filter_.get()); 394 AddEnvEventFilter(overlay_filter_.get());
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 } 505 }
508 506
509 void Shell::AddEnvEventFilter(aura::EventFilter* filter) { 507 void Shell::AddEnvEventFilter(aura::EventFilter* filter) {
510 aura::Env::GetInstance()->AddPreTargetHandler(filter); 508 aura::Env::GetInstance()->AddPreTargetHandler(filter);
511 } 509 }
512 510
513 void Shell::RemoveEnvEventFilter(aura::EventFilter* filter) { 511 void Shell::RemoveEnvEventFilter(aura::EventFilter* filter) {
514 aura::Env::GetInstance()->RemovePreTargetHandler(filter); 512 aura::Env::GetInstance()->RemovePreTargetHandler(filter);
515 } 513 }
516 514
517 void Shell::ShowBackgroundMenu(views::Widget* widget, 515 void Shell::ShowContextMenu(const gfx::Point& location) {
518 const gfx::Point& location) {
519 // No context menus if user have not logged in. 516 // No context menus if user have not logged in.
520 if (!delegate_.get() || !delegate_->IsUserLoggedIn()) 517 if (!delegate_.get() || !delegate_->IsUserLoggedIn())
521 return; 518 return;
522 // No context menus when screen is locked. 519 // No context menus when screen is locked.
523 if (IsScreenLocked()) 520 if (IsScreenLocked())
524 return; 521 return;
525 if (shell_context_menu_.get()) 522 launcher()->ShowContextMenu(location);
sky 2012/10/10 04:07:17 NULL check this sine it can be NULL.
526 shell_context_menu_->ShowMenu(widget, location);
527 } 523 }
528 524
529 void Shell::ToggleAppList() { 525 void Shell::ToggleAppList() {
530 if (!app_list_controller_.get()) 526 if (!app_list_controller_.get())
531 app_list_controller_.reset(new internal::AppListController); 527 app_list_controller_.reset(new internal::AppListController);
532 app_list_controller_->SetVisible(!app_list_controller_->IsVisible()); 528 app_list_controller_->SetVisible(!app_list_controller_->IsVisible());
533 } 529 }
534 530
535 bool Shell::GetAppListTargetVisibility() const { 531 bool Shell::GetAppListTargetVisibility() const {
536 return app_list_controller_.get() && 532 return app_list_controller_.get() &&
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 iter != controllers.end(); ++iter) { 811 iter != controllers.end(); ++iter) {
816 if ((*iter)->GetSystemModalLayoutManager()-> 812 if ((*iter)->GetSystemModalLayoutManager()->
817 CanWindowReceiveEvents(window)) { 813 CanWindowReceiveEvents(window)) {
818 return true; 814 return true;
819 } 815 }
820 } 816 }
821 return false; 817 return false;
822 } 818 }
823 819
824 } // namespace ash 820 } // namespace ash
OLDNEW
« ash/shell.h ('K') | « ash/shell.h ('k') | ash/shell_context_menu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698