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

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: 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
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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 active_root_window_(NULL), 204 active_root_window_(NULL),
205 delegate_(delegate), 205 delegate_(delegate),
206 activation_client_(NULL), 206 activation_client_(NULL),
207 #if defined(OS_CHROMEOS) && defined(USE_X11) 207 #if defined(OS_CHROMEOS) && defined(USE_X11)
208 output_configurator_(new chromeos::OutputConfigurator()), 208 output_configurator_(new chromeos::OutputConfigurator()),
209 #endif // defined(OS_CHROMEOS) 209 #endif // defined(OS_CHROMEOS)
210 native_cursor_manager_(new AshNativeCursorManager), 210 native_cursor_manager_(new AshNativeCursorManager),
211 cursor_manager_(scoped_ptr<views::corewm::NativeCursorManager>( 211 cursor_manager_(scoped_ptr<views::corewm::NativeCursorManager>(
212 native_cursor_manager_)), 212 native_cursor_manager_)),
213 browser_context_(NULL), 213 browser_context_(NULL),
214 simulate_modal_window_open_for_testing_(false), 214 simulate_modal_window_open_for_testing_(false) {
215 is_touch_hud_projection_enabled_(false) {
216 DCHECK(delegate_.get()); 215 DCHECK(delegate_.get());
217 display_manager_.reset(new internal::DisplayManager); 216 display_manager_.reset(new internal::DisplayManager);
218 mirror_window_controller_.reset(new internal::MirrorWindowController); 217 mirror_window_controller_.reset(new internal::MirrorWindowController);
219 218
220 ANNOTATE_LEAKING_OBJECT_PTR(screen_); // see crbug.com/156466 219 ANNOTATE_LEAKING_OBJECT_PTR(screen_); // see crbug.com/156466
221 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_ALTERNATE, screen_); 220 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_ALTERNATE, screen_);
222 if (!gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE)) 221 if (!gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE))
223 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_); 222 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_);
224 display_controller_.reset(new DisplayController); 223 display_controller_.reset(new DisplayController);
225 #if defined(OS_CHROMEOS) && defined(USE_X11) 224 #if defined(OS_CHROMEOS) && defined(USE_X11)
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 launcher_model_.reset(new LauncherModel); 853 launcher_model_.reset(new LauncherModel);
855 // Attempt to create the Launcher. This may fail if the application is not 854 // Attempt to create the Launcher. This may fail if the application is not
856 // ready to create it yet, in which case the app is responsible for calling 855 // ready to create it yet, in which case the app is responsible for calling
857 // ash::Shell::CreateLauncher() when ready. 856 // ash::Shell::CreateLauncher() when ready.
858 launcher_delegate_.reset( 857 launcher_delegate_.reset(
859 delegate_->CreateLauncherDelegate(launcher_model_.get())); 858 delegate_->CreateLauncherDelegate(launcher_model_.get()));
860 } 859 }
861 return launcher_delegate_.get(); 860 return launcher_delegate_.get();
862 } 861 }
863 862
864 void Shell::SetTouchHudProjectionEnabled(bool enabled) { 863 void Shell::TouchHudProjectionEnabledChanged(bool enabled) {
865 if (is_touch_hud_projection_enabled_ == enabled)
866 return;
867
868 RootWindowList roots = GetInstance()->GetAllRootWindows(); 864 RootWindowList roots = GetInstance()->GetAllRootWindows();
869 for (RootWindowList::iterator iter = roots.begin(); iter != roots.end(); 865 for (RootWindowList::iterator iter = roots.begin(); iter != roots.end();
870 ++iter) { 866 ++iter) {
871 internal::RootWindowController* controller = GetRootWindowController(*iter); 867 internal::RootWindowController* controller = GetRootWindowController(*iter);
872 if (enabled) 868 if (enabled)
873 controller->EnableTouchHudProjection(); 869 controller->EnableTouchHudProjection();
874 else 870 else
875 controller->DisableTouchHudProjection(); 871 controller->DisableTouchHudProjection();
876 } 872 }
877 is_touch_hud_projection_enabled_ = enabled;
878 } 873 }
879 874
880 void Shell::InitRootWindowForSecondaryDisplay(aura::RootWindow* root) { 875 void Shell::InitRootWindowForSecondaryDisplay(aura::RootWindow* root) {
881 aura::client::SetFocusClient(root, focus_client_.get()); 876 aura::client::SetFocusClient(root, focus_client_.get());
882 internal::RootWindowController* controller = 877 internal::RootWindowController* controller =
883 new internal::RootWindowController(root); 878 new internal::RootWindowController(root);
884 controller->CreateContainers(); 879 controller->CreateContainers();
885 // Pass false for the |is_first_run_after_boot| parameter so we'll show a 880 // Pass false for the |is_first_run_after_boot| parameter so we'll show a
886 // black background on this display instead of trying to mimic the boot splash 881 // black background on this display instead of trying to mimic the boot splash
887 // screen. 882 // screen.
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 //////////////////////////////////////////////////////////////////////////////// 981 ////////////////////////////////////////////////////////////////////////////////
987 // Shell, aura::client::ActivationChangeObserver implementation: 982 // Shell, aura::client::ActivationChangeObserver implementation:
988 983
989 void Shell::OnWindowActivated(aura::Window* gained_active, 984 void Shell::OnWindowActivated(aura::Window* gained_active,
990 aura::Window* lost_active) { 985 aura::Window* lost_active) {
991 if (gained_active) 986 if (gained_active)
992 active_root_window_ = gained_active->GetRootWindow(); 987 active_root_window_ = gained_active->GetRootWindow();
993 } 988 }
994 989
995 } // namespace ash 990 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698