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

Side by Side Diff: chrome/browser/ui/ash/ash_init.cc

Issue 10915140: Add the partial screen magnifier to Chrome OS. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Code review fixes 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
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 "chrome/browser/ui/ash/ash_init.h" 5 #include "chrome/browser/ui/ash/ash_init.h"
6 6
7 #include "ash/accelerators/accelerator_controller.h" 7 #include "ash/accelerators/accelerator_controller.h"
8 #include "ash/ash_switches.h" 8 #include "ash/ash_switches.h"
9 #include "ash/high_contrast/high_contrast_controller.h" 9 #include "ash/high_contrast/high_contrast_controller.h"
10 #include "ash/magnifier/magnification_controller.h" 10 #include "ash/magnifier/magnification_controller.h"
11 #include "ash/magnifier/partial_magnification_controller.h"
11 #include "ash/shell.h" 12 #include "ash/shell.h"
12 #include "ash/wm/event_rewriter_event_filter.h" 13 #include "ash/wm/event_rewriter_event_filter.h"
13 #include "ash/wm/property_util.h" 14 #include "ash/wm/property_util.h"
14 #include "base/command_line.h" 15 #include "base/command_line.h"
15 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" 16 #include "chrome/browser/chromeos/accessibility/accessibility_util.h"
16 #include "chrome/browser/lifetime/application_lifetime.h" 17 #include "chrome/browser/lifetime/application_lifetime.h"
17 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" 18 #include "chrome/browser/ui/ash/chrome_shell_delegate.h"
18 #include "chrome/browser/ui/ash/event_rewriter.h" 19 #include "chrome/browser/ui/ash/event_rewriter.h"
19 #include "chrome/browser/ui/ash/screenshot_taker.h" 20 #include "chrome/browser/ui/ash/screenshot_taker.h"
20 #include "chrome/common/chrome_switches.h" 21 #include "chrome/common/chrome_switches.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 scoped_ptr<ash::BrightnessControlDelegate>( 83 scoped_ptr<ash::BrightnessControlDelegate>(
83 new BrightnessController).Pass()); 84 new BrightnessController).Pass());
84 shell->accelerator_controller()->SetImeControlDelegate( 85 shell->accelerator_controller()->SetImeControlDelegate(
85 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass()); 86 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass());
86 shell->accelerator_controller()->SetKeyboardBrightnessControlDelegate( 87 shell->accelerator_controller()->SetKeyboardBrightnessControlDelegate(
87 scoped_ptr<ash::KeyboardBrightnessControlDelegate>( 88 scoped_ptr<ash::KeyboardBrightnessControlDelegate>(
88 new KeyboardBrightnessController).Pass()); 89 new KeyboardBrightnessController).Pass());
89 ash::Shell::GetInstance()->high_contrast_controller()->SetEnabled( 90 ash::Shell::GetInstance()->high_contrast_controller()->SetEnabled(
90 chromeos::accessibility::IsHighContrastEnabled()); 91 chromeos::accessibility::IsHighContrastEnabled());
91 92
93 chromeos::accessibility::ScreenMagnifierType magnifier_type =
94 chromeos::accessibility::GetScreenMagnifierType();
92 ash::Shell::GetInstance()->magnification_controller()->SetEnabled( 95 ash::Shell::GetInstance()->magnification_controller()->SetEnabled(
93 chromeos::accessibility::IsScreenMagnifierEnabled()); 96 magnifier_type == chromeos::accessibility::MagnifierFull);
97 ash::Shell::GetInstance()->partial_magnification_controller()->SetEnabled(
98 magnifier_type == chromeos::accessibility::MagnifierPartial);
94 99
95 if (!CommandLine::ForCurrentProcess()->HasSwitch( 100 if (!CommandLine::ForCurrentProcess()->HasSwitch(
96 switches::kDisableZeroBrowsersOpenForTests)) { 101 switches::kDisableZeroBrowsersOpenForTests)) {
97 browser::StartKeepAlive(); 102 browser::StartKeepAlive();
98 } 103 }
99 #endif 104 #endif
100 ash::Shell::GetPrimaryRootWindow()->ShowRootWindow(); 105 ash::Shell::GetPrimaryRootWindow()->ShowRootWindow();
101 } 106 }
102 107
103 void CloseAsh() { 108 void CloseAsh() {
104 if (ash::Shell::GetInstance()) 109 if (ash::Shell::GetInstance())
105 ash::Shell::DeleteInstance(); 110 ash::Shell::DeleteInstance();
106 } 111 }
107 112
108 } // namespace chrome 113 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698