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

Side by Side Diff: ash/shell.cc

Issue 18163006: Add persisted preference for projection touch HUD (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resolved clang compile errors + Resolved linux_chromeos trybot failure Created 7 years, 5 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 | « ash/root_window_controller.cc ('k') | ash/shell_observer.h » ('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 "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"
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 void Shell::SetDisplayWorkAreaInsets(Window* contains, 708 void Shell::SetDisplayWorkAreaInsets(Window* contains,
709 const gfx::Insets& insets) { 709 const gfx::Insets& insets) {
710 if (!display_manager_->UpdateWorkAreaOfDisplayNearestWindow(contains, insets)) 710 if (!display_manager_->UpdateWorkAreaOfDisplayNearestWindow(contains, insets))
711 return; 711 return;
712 FOR_EACH_OBSERVER(ShellObserver, observers_, 712 FOR_EACH_OBSERVER(ShellObserver, observers_,
713 OnDisplayWorkAreaInsetsChanged()); 713 OnDisplayWorkAreaInsetsChanged());
714 } 714 }
715 715
716 void Shell::OnLoginStateChanged(user::LoginStatus status) { 716 void Shell::OnLoginStateChanged(user::LoginStatus status) {
717 FOR_EACH_OBSERVER(ShellObserver, observers_, OnLoginStateChanged(status)); 717 FOR_EACH_OBSERVER(ShellObserver, observers_, OnLoginStateChanged(status));
718 RootWindowControllerList controllers = GetAllRootWindowControllers();
719 for (RootWindowControllerList::iterator iter = controllers.begin();
720 iter != controllers.end(); ++iter)
721 (*iter)->OnLoginStateChanged(status);
722 } 718 }
723 719
724 void Shell::UpdateAfterLoginStatusChange(user::LoginStatus status) { 720 void Shell::UpdateAfterLoginStatusChange(user::LoginStatus status) {
725 RootWindowControllerList controllers = GetAllRootWindowControllers(); 721 RootWindowControllerList controllers = GetAllRootWindowControllers();
726 for (RootWindowControllerList::iterator iter = controllers.begin(); 722 for (RootWindowControllerList::iterator iter = controllers.begin();
727 iter != controllers.end(); ++iter) 723 iter != controllers.end(); ++iter)
728 (*iter)->UpdateAfterLoginStatusChange(status); 724 (*iter)->UpdateAfterLoginStatusChange(status);
729 } 725 }
730 726
731 void Shell::OnAppTerminating() { 727 void Shell::OnAppTerminating() {
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 launcher_delegate_.reset( 843 launcher_delegate_.reset(
848 delegate_->CreateLauncherDelegate(launcher_model_.get())); 844 delegate_->CreateLauncherDelegate(launcher_model_.get()));
849 } 845 }
850 return launcher_delegate_.get(); 846 return launcher_delegate_.get();
851 } 847 }
852 848
853 void Shell::SetTouchHudProjectionEnabled(bool enabled) { 849 void Shell::SetTouchHudProjectionEnabled(bool enabled) {
854 if (is_touch_hud_projection_enabled_ == enabled) 850 if (is_touch_hud_projection_enabled_ == enabled)
855 return; 851 return;
856 852
857 RootWindowList roots = GetInstance()->GetAllRootWindows();
858 for (RootWindowList::iterator iter = roots.begin(); iter != roots.end();
859 ++iter) {
860 internal::RootWindowController* controller = GetRootWindowController(*iter);
861 if (enabled)
862 controller->EnableTouchHudProjection();
863 else
864 controller->DisableTouchHudProjection();
865 }
866 is_touch_hud_projection_enabled_ = enabled; 853 is_touch_hud_projection_enabled_ = enabled;
854 FOR_EACH_OBSERVER(ShellObserver, observers_,
855 OnTouchHudProjectionToggled(enabled));
867 } 856 }
868 857
869 void Shell::InitRootWindowForSecondaryDisplay(aura::RootWindow* root) { 858 void Shell::InitRootWindowForSecondaryDisplay(aura::RootWindow* root) {
870 internal::RootWindowController* controller = 859 internal::RootWindowController* controller =
871 new internal::RootWindowController(root); 860 new internal::RootWindowController(root);
872 // Pass false for the |is_first_run_after_boot| parameter so we'll show a 861 // Pass false for the |is_first_run_after_boot| parameter so we'll show a
873 // black background on this display instead of trying to mimic the boot splash 862 // black background on this display instead of trying to mimic the boot splash
874 // screen. 863 // screen.
875 InitRootWindowController(controller, false); 864 InitRootWindowController(controller, false);
876 865
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 //////////////////////////////////////////////////////////////////////////////// 952 ////////////////////////////////////////////////////////////////////////////////
964 // Shell, aura::client::ActivationChangeObserver implementation: 953 // Shell, aura::client::ActivationChangeObserver implementation:
965 954
966 void Shell::OnWindowActivated(aura::Window* gained_active, 955 void Shell::OnWindowActivated(aura::Window* gained_active,
967 aura::Window* lost_active) { 956 aura::Window* lost_active) {
968 if (gained_active) 957 if (gained_active)
969 active_root_window_ = gained_active->GetRootWindow(); 958 active_root_window_ = gained_active->GetRootWindow();
970 } 959 }
971 960
972 } // namespace ash 961 } // namespace ash
OLDNEW
« no previous file with comments | « ash/root_window_controller.cc ('k') | ash/shell_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698