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

Side by Side Diff: ash/shell.cc

Issue 12505005: Store rotation/ui scale to local state. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 cursor_manager_(scoped_ptr<views::corewm::NativeCursorManager>( 206 cursor_manager_(scoped_ptr<views::corewm::NativeCursorManager>(
207 native_cursor_manager_)), 207 native_cursor_manager_)),
208 browser_context_(NULL), 208 browser_context_(NULL),
209 simulate_modal_window_open_for_testing_(false) { 209 simulate_modal_window_open_for_testing_(false) {
210 DCHECK(delegate_.get()); 210 DCHECK(delegate_.get());
211 display_manager_.reset(new internal::DisplayManager); 211 display_manager_.reset(new internal::DisplayManager);
212 ANNOTATE_LEAKING_OBJECT_PTR(screen_); // see crbug.com/156466 212 ANNOTATE_LEAKING_OBJECT_PTR(screen_); // see crbug.com/156466
213 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_ALTERNATE, screen_); 213 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_ALTERNATE, screen_);
214 if (!gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE)) 214 if (!gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE))
215 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_); 215 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_);
216 display_controller_.reset(new DisplayController);
216 #if defined(OS_CHROMEOS) 217 #if defined(OS_CHROMEOS)
217 content::GpuFeatureType blacklisted_features = 218 content::GpuFeatureType blacklisted_features =
218 content::GpuDataManager::GetInstance()->GetBlacklistedFeatures(); 219 content::GpuDataManager::GetInstance()->GetBlacklistedFeatures();
219 bool is_panel_fitting_disabled = 220 bool is_panel_fitting_disabled =
220 (blacklisted_features & content::GPU_FEATURE_TYPE_PANEL_FITTING) || 221 (blacklisted_features & content::GPU_FEATURE_TYPE_PANEL_FITTING) ||
221 CommandLine::ForCurrentProcess()->HasSwitch( 222 CommandLine::ForCurrentProcess()->HasSwitch(
222 ::switches::kDisablePanelFitting); 223 ::switches::kDisablePanelFitting);
223 224
224 output_configurator_->Init( 225 output_configurator_->Init(
225 !is_panel_fitting_disabled, 226 !is_panel_fitting_disabled,
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 focus_client_.get(), 456 focus_client_.get(),
456 new internal::AshActivationController)); 457 new internal::AshActivationController));
457 activation_client_ = activation_controller_.get(); 458 activation_client_ = activation_controller_.get();
458 AddPreTargetHandler(activation_controller_.get()); 459 AddPreTargetHandler(activation_controller_.get());
459 } 460 }
460 461
461 focus_cycler_.reset(new internal::FocusCycler()); 462 focus_cycler_.reset(new internal::FocusCycler());
462 463
463 screen_position_controller_.reset(new internal::ScreenPositionController); 464 screen_position_controller_.reset(new internal::ScreenPositionController);
464 root_window_host_factory_.reset(delegate_->CreateRootWindowHostFactory()); 465 root_window_host_factory_.reset(delegate_->CreateRootWindowHostFactory());
465 display_controller_.reset(new DisplayController); 466 display_controller_->Start();
466 display_controller_->InitPrimaryDisplay(); 467 display_controller_->InitPrimaryDisplay();
467 aura::RootWindow* root_window = display_controller_->GetPrimaryRootWindow(); 468 aura::RootWindow* root_window = display_controller_->GetPrimaryRootWindow();
468 active_root_window_ = root_window; 469 active_root_window_ = root_window;
469 470
470 cursor_manager_.SetDisplay(DisplayController::GetPrimaryDisplay()); 471 cursor_manager_.SetDisplay(DisplayController::GetPrimaryDisplay());
471 472
472 #if !defined(OS_MACOSX) 473 #if !defined(OS_MACOSX)
473 nested_dispatcher_controller_.reset(new NestedDispatcherController); 474 nested_dispatcher_controller_.reset(new NestedDispatcherController);
474 accelerator_controller_.reset(new AcceleratorController); 475 accelerator_controller_.reset(new AcceleratorController);
475 #endif 476 #endif
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 //////////////////////////////////////////////////////////////////////////////// 949 ////////////////////////////////////////////////////////////////////////////////
949 // Shell, aura::client::ActivationChangeObserver implementation: 950 // Shell, aura::client::ActivationChangeObserver implementation:
950 951
951 void Shell::OnWindowActivated(aura::Window* gained_active, 952 void Shell::OnWindowActivated(aura::Window* gained_active,
952 aura::Window* lost_active) { 953 aura::Window* lost_active) {
953 if (gained_active) 954 if (gained_active)
954 active_root_window_ = gained_active->GetRootWindow(); 955 active_root_window_ = gained_active->GetRootWindow();
955 } 956 }
956 957
957 } // namespace ash 958 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698