Commit dddc4a07 authored by ben@chromium.org's avatar ben@chromium.org

Reverting this CL because it was committed before I gave the final LGTM.

Revert 162142 - Full Screen Magnifier: Add MagnificationManager

MagnificationManager controls the full screen magnifier from chrome-browser side (not ash side. Note that MagnificationController is on ash side).

MagnificationManager does:
- Watch logged-in. Change the behavior between the login screen and user desktop. 
- Watch change of the pref. When the pref changes, the setting of the magnifier will interlock with it.

In addition, this patch make the magnifier settings per-user instead of per-device.

BUG=151891
TEST=manual, browser_test passes.

Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=162080

Review URL: https://chromiumcodereview.appspot.com/11065008

TBR=yoshiki@chromium.org
Review URL: https://codereview.chromium.org/11194011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162211 0039d316-1c4b-4281-b951-d872f2087c98
parent dd81d183
...@@ -48,7 +48,6 @@ class MagnificationControllerImpl : virtual public MagnificationController, ...@@ -48,7 +48,6 @@ class MagnificationControllerImpl : virtual public MagnificationController,
// MagnificationController overrides: // MagnificationController overrides:
virtual void SetEnabled(bool enabled) OVERRIDE; virtual void SetEnabled(bool enabled) OVERRIDE;
virtual bool IsEnabled() OVERRIDE { return is_enabled_; }
virtual void SetScale(float scale, bool animate) OVERRIDE; virtual void SetScale(float scale, bool animate) OVERRIDE;
virtual float GetScale() const OVERRIDE { return scale_; } virtual float GetScale() const OVERRIDE { return scale_; }
virtual void MoveWindow(int x, int y, bool animate) OVERRIDE; virtual void MoveWindow(int x, int y, bool animate) OVERRIDE;
......
...@@ -30,9 +30,6 @@ class MagnificationController { ...@@ -30,9 +30,6 @@ class MagnificationController {
// Enables (or disables if |enabled| is false) screen magnifier feature. // Enables (or disables if |enabled| is false) screen magnifier feature.
virtual void SetEnabled(bool enabled) = 0; virtual void SetEnabled(bool enabled) = 0;
// Returns if the screen magnifier is enabled or not.
virtual bool IsEnabled() = 0;
// Sets the magnification ratio. 1.0f means no magnification. // Sets the magnification ratio. 1.0f means no magnification.
virtual void SetScale(float scale, bool animate) = 0; virtual void SetScale(float scale, bool animate) = 0;
// Returns the current magnification ratio. // Returns the current magnification ratio.
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "base/logging.h" #include "base/logging.h"
#include "chrome/browser/accessibility/accessibility_extension_api.h" #include "chrome/browser/accessibility/accessibility_extension_api.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/accessibility/magnification_manager.h"
#include "chrome/browser/extensions/component_loader.h" #include "chrome/browser/extensions/component_loader.h"
#include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/file_reader.h" #include "chrome/browser/extensions/file_reader.h"
...@@ -177,8 +176,13 @@ void EnableHighContrast(bool enabled) { ...@@ -177,8 +176,13 @@ void EnableHighContrast(bool enabled) {
} }
void EnableScreenMagnifier(bool enabled) { void EnableScreenMagnifier(bool enabled) {
if (MagnificationManager::GetInstance()) PrefService* pref_service = g_browser_process->local_state();
MagnificationManager::GetInstance()->SetEnabled(enabled); pref_service->SetBoolean(prefs::kScreenMagnifierEnabled, enabled);
pref_service->CommitPendingWrite();
#if defined(USE_ASH)
ash::Shell::GetInstance()->magnification_controller()->SetEnabled(enabled);
#endif
} }
void EnableVirtualKeyboard(bool enabled) { void EnableVirtualKeyboard(bool enabled) {
...@@ -231,8 +235,12 @@ bool IsHighContrastEnabled() { ...@@ -231,8 +235,12 @@ bool IsHighContrastEnabled() {
} }
bool IsScreenMagnifierEnabled() { bool IsScreenMagnifierEnabled() {
return MagnificationManager::GetInstance() && if (!g_browser_process) {
MagnificationManager::GetInstance()->IsEnabled(); return false;
}
PrefService* prefs = g_browser_process->local_state();
bool enabled = prefs && prefs->GetBoolean(prefs::kScreenMagnifierEnabled);
return enabled;
} }
void MaybeSpeak(const std::string& utterance) { void MaybeSpeak(const std::string& utterance) {
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/chromeos/accessibility/magnification_manager.h"
#include "ash/magnifier/magnification_controller.h"
#include "ash/shell.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
#include "chrome/browser/api/prefs/pref_change_registrar.h"
#include "chrome/browser/api/prefs/pref_member.h"
#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_service.h"
namespace chromeos {
class MagnificationManagerImpl : public MagnificationManager,
public content::NotificationObserver {
public:
MagnificationManagerImpl() {
DCHECK(!instance_);
instance_ = this;
registrar_.Add(this,
chrome::NOTIFICATION_SESSION_STARTED,
content::NotificationService::AllSources());
registrar_.Add(this,
chrome::NOTIFICATION_PROFILE_CREATED,
content::NotificationService::AllSources());
registrar_.Add(this,
chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE,
content::NotificationService::AllSources());
Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord();
SetProfile(profile);
}
virtual ~MagnificationManagerImpl() {}
static MagnificationManagerImpl* GetInstance() {
return instance_;
}
// MagnificationManager implimentation:
bool IsEnabled() OVERRIDE {
return ash::Shell::GetInstance()->magnification_controller()->IsEnabled();
}
void SetEnabled(bool enabled) OVERRIDE {
ash::Shell::GetInstance()->magnification_controller()->SetEnabled(enabled);
}
private:
void SetProfile(Profile* profile) {
if (pref_change_registrar_) {
pref_change_registrar_->Remove(prefs::kScreenMagnifierEnabled, this);
pref_change_registrar_.reset();
}
if (profile) {
pref_change_registrar_.reset(new PrefChangeRegistrar);
pref_change_registrar_->Init(profile->GetPrefs());
pref_change_registrar_->Add(prefs::kScreenMagnifierEnabled, this);
}
profile_ = profile;
UpdateMagnifierStatus();
}
void UpdateMagnifierStatus() {
UserManager* manager = UserManager::Get();
if (!profile_) {
SetEnabled(false);
} else if (manager && !manager->IsSessionStarted()) {
SetEnabled(true);
} else {
PrefService* pref_service = profile_->GetPrefs();
bool enabled = pref_service->GetBoolean(prefs::kScreenMagnifierEnabled);
SetEnabled(enabled);
}
}
// content::NotificationObserver implimentation:
virtual void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE {
switch (type) {
case chrome::NOTIFICATION_PREF_CHANGED: {
std::string pref = *content::Details<std::string>(details).ptr();
if (pref == prefs::kScreenMagnifierEnabled)
UpdateMagnifierStatus();
break;
}
case chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE:
case chrome::NOTIFICATION_SESSION_STARTED: {
Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord();
SetProfile(profile);
break;
}
}
}
static MagnificationManagerImpl* instance_;
Profile* profile_;
content::NotificationRegistrar registrar_;
scoped_ptr<PrefChangeRegistrar> pref_change_registrar_;
friend struct DefaultSingletonTraits<MagnificationManagerImpl>;
DISALLOW_COPY_AND_ASSIGN(MagnificationManagerImpl);
};
MagnificationManagerImpl* MagnificationManagerImpl::instance_ = NULL;
MagnificationManager* MagnificationManager::GetInstance() {
return MagnificationManagerImpl::GetInstance();
}
MagnificationManager* MagnificationManager::CreateInstance() {
// Makes sure that this is not called more than once.
CHECK(!GetInstance());
return new MagnificationManagerImpl();
}
} // namespace chromeos
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_MAGNIFICATION_MANAGER_H_
#define CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_MAGNIFICATION_MANAGER_H_
namespace chromeos {
// MagnificationManager controls the full screen magnifier from chrome-browser
// side (not ash side).
//
// MagnificationManager does:
// - Watch logged-in. Changes the behavior between the login screen and user
// desktop.
// - Watch change of the pref. When the pref changes, the setting of the
// magnifier will interlock with it.
class MagnificationManager {
public:
// Creates an instance of MagnificationManager. This should be called once,
// because only one instance should exist at the same time.
static MagnificationManager* CreateInstance();
// Returns the existing instance. If there is no instance, returns NULL.
static MagnificationManager* GetInstance();
virtual ~MagnificationManager() {}
// Returns if the magnifier is enabled or not.
virtual bool IsEnabled() = 0;
// Enables (or disables if |enabled| is false) the magnifierh.
virtual void SetEnabled(bool enabled) = 0;
};
} // namespace chromeos
#endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_MAGNIFICATION_MANAGER_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/command_line.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/accessibility/magnification_manager.h"
#include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h"
#include "chrome/browser/chromeos/cros/cros_mock.h"
#include "chrome/browser/chromeos/cros/mock_network_library.h"
#include "chrome/browser/chromeos/login/helper.h"
#include "chrome/browser/chromeos/login/login_utils.h"
#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/chromeos/login/user_manager_impl.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/testing_profile.h"
#include "chromeos/dbus/mock_cros_disks_client.h"
#include "chromeos/dbus/mock_dbus_thread_manager.h"
#include "chromeos/dbus/mock_power_manager_client.h"
#include "chromeos/dbus/mock_session_manager_client.h"
#include "content/public/test/test_utils.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
using ::testing::_;
using ::testing::AnyNumber;
using ::testing::Return;
namespace chromeos {
class MagnificationManagerTest : public CrosInProcessBrowserTest {
protected:
MagnificationManagerTest() {}
virtual ~MagnificationManagerTest() {}
virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
MockDBusThreadManager* mock_dbus_thread_manager =
new MockDBusThreadManager;
EXPECT_CALL(*mock_dbus_thread_manager, GetSystemBus())
.WillRepeatedly(Return(reinterpret_cast<dbus::Bus*>(NULL)));
DBusThreadManager::InitializeForTesting(mock_dbus_thread_manager);
CrosInProcessBrowserTest::SetUpInProcessBrowserTestFixture();
cros_mock_->InitStatusAreaMocks();
cros_mock_->SetStatusAreaMocksExpectations();
MockNetworkLibrary* mock_network_library_ =
cros_mock_->mock_network_library();
EXPECT_CALL(*mock_network_library_, AddUserActionObserver(_))
.Times(AnyNumber());
EXPECT_CALL(*mock_network_library_, LoadOncNetworks(_, _, _, _, _))
.WillRepeatedly(Return(true));
MockSessionManagerClient* mock_session_manager_client =
mock_dbus_thread_manager->mock_session_manager_client();
EXPECT_CALL(*mock_session_manager_client, RetrieveDevicePolicy(_))
.Times(AnyNumber());
EXPECT_CALL(*mock_session_manager_client, HasObserver(_))
.WillRepeatedly(Return(false));
MockPowerManagerClient* mock_update_engine_client =
mock_dbus_thread_manager->mock_power_manager_client();
EXPECT_CALL(*mock_update_engine_client, HasObserver(_))
.WillRepeatedly(Return(false));
MockCrosDisksClient* mock_cros_disks_client =
mock_dbus_thread_manager->mock_cros_disks_client();
EXPECT_CALL(*mock_cros_disks_client, EnumerateAutoMountableDevices(_, _))
.Times(AnyNumber());
EXPECT_CALL(*mock_cros_disks_client, SetUpConnections(_, _))
.Times(AnyNumber());
}
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
command_line->AppendSwitch(switches::kLoginManager);
command_line->AppendSwitchASCII(switches::kLoginProfile,
TestingProfile::kTestUserProfileDir);
}
Profile* profile() {
Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord();
DCHECK(profile);
return profile;
}
PrefServiceBase* prefs() {
return PrefServiceBase::FromBrowserContext(profile());
}
DISALLOW_COPY_AND_ASSIGN(MagnificationManagerTest);
};
IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, Login) {
// Confirms that magnifier is enabled on the login screen.
EXPECT_TRUE(MagnificationManager::GetInstance()->IsEnabled());
// Logs in.
UserManager::Get()->UserLoggedIn("owner@invalid.domain", true);
UserManager::Get()->SessionStarted();
// Confirms that magnifier is disabled just after login.
EXPECT_FALSE(MagnificationManager::GetInstance()->IsEnabled());
// Enables magnifier.
MagnificationManager::GetInstance()->SetEnabled(true);
// Confirms that magnifier is enabled.
EXPECT_TRUE(MagnificationManager::GetInstance()->IsEnabled());
}
IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, WorkingWithPref) {
// Logs in
UserManager::Get()->UserLoggedIn("owner@invalid.domain", true);
UserManager::Get()->SessionStarted();
// Confirms that magnifier is disabled just after login.
EXPECT_FALSE(MagnificationManager::GetInstance()->IsEnabled());
// Sets the pref as true to enable magnifier.
prefs()->SetBoolean(prefs::kScreenMagnifierEnabled, true);
// Confirms that magnifier is enabled.
EXPECT_TRUE(MagnificationManager::GetInstance()->IsEnabled());
// Sets the pref as false to disabled magnifier.
prefs()->SetBoolean(prefs::kScreenMagnifierEnabled, false);
// Confirms that magnifier is disabled.
EXPECT_FALSE(MagnificationManager::GetInstance()->IsEnabled());
// Sets the pref as true to enable magnifier again.
prefs()->SetBoolean(prefs::kScreenMagnifierEnabled, true);
// Confirms that magnifier is enabled.
EXPECT_TRUE(MagnificationManager::GetInstance()->IsEnabled());
}
IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, ResumeSavedPref) {
// Loads the profile of the user.
UserManager::Get()->UserLoggedIn("owner@invalid.domain", true);
// Sets the pref as true to enable magnifier before login.
prefs()->SetBoolean(prefs::kScreenMagnifierEnabled, true);
// Logs in.
UserManager::Get()->SessionStarted();
// Confirms that magnifier is enabled just after login.
EXPECT_TRUE(MagnificationManager::GetInstance()->IsEnabled());
}
} // namespace chromeos
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include "base/string_number_conversions.h" #include "base/string_number_conversions.h"
#include "base/string_split.h" #include "base/string_split.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/accessibility/magnification_manager.h"
#include "chrome/browser/chromeos/audio/audio_handler.h" #include "chrome/browser/chromeos/audio/audio_handler.h"
#include "chrome/browser/chromeos/boot_times_loader.h" #include "chrome/browser/chromeos/boot_times_loader.h"
#include "chrome/browser/chromeos/contacts/contact_manager.h" #include "chrome/browser/chromeos/contacts/contact_manager.h"
...@@ -459,8 +458,6 @@ void ChromeBrowserMainPartsChromeos::PostProfileInit() { ...@@ -459,8 +458,6 @@ void ChromeBrowserMainPartsChromeos::PostProfileInit() {
power_state_override_.reset(new chromeos::PowerStateOverride( power_state_override_.reset(new chromeos::PowerStateOverride(
chromeos::PowerStateOverride::BLOCK_DISPLAY_SLEEP)); chromeos::PowerStateOverride::BLOCK_DISPLAY_SLEEP));
} }
magnification_manager_.reset(
chromeos::MagnificationManager::CreateInstance());
primary_display_switch_observer_.reset( primary_display_switch_observer_.reset(
new chromeos::PrimaryDisplaySwitchObserver()); new chromeos::PrimaryDisplaySwitchObserver());
...@@ -545,7 +542,6 @@ void ChromeBrowserMainPartsChromeos::PostMainMessageLoopRun() { ...@@ -545,7 +542,6 @@ void ChromeBrowserMainPartsChromeos::PostMainMessageLoopRun() {
brightness_observer_.reset(); brightness_observer_.reset();
output_observer_.reset(); output_observer_.reset();
power_state_override_.reset(); power_state_override_.reset();
magnification_manager_.reset();
// The XInput2 event listener needs to be shut down earlier than when // The XInput2 event listener needs to be shut down earlier than when
// Singletons are finally destroyed in AtExitManager. // Singletons are finally destroyed in AtExitManager.
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
namespace chromeos { namespace chromeos {
class BrightnessObserver; class BrightnessObserver;
class MagnificationManager;
class OutputObserver; class OutputObserver;
class PowerButtonObserver; class PowerButtonObserver;
class PowerStateOverride; class PowerStateOverride;
...@@ -69,7 +68,6 @@ class ChromeBrowserMainPartsChromeos : public ChromeBrowserMainPartsLinux { ...@@ -69,7 +68,6 @@ class ChromeBrowserMainPartsChromeos : public ChromeBrowserMainPartsLinux {
scoped_ptr<chromeos::ScreenDimmingObserver> screen_dimming_observer_; scoped_ptr<chromeos::ScreenDimmingObserver> screen_dimming_observer_;
scoped_refptr<chromeos::RemovableDeviceNotificationsCros> scoped_refptr<chromeos::RemovableDeviceNotificationsCros>
removable_device_notifications_; removable_device_notifications_;
scoped_ptr<chromeos::MagnificationManager> magnification_manager_;
DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainPartsChromeos); DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainPartsChromeos);
}; };
......
...@@ -410,6 +410,11 @@ void WizardController::RegisterPrefs(PrefService* local_state) { ...@@ -410,6 +410,11 @@ void WizardController::RegisterPrefs(PrefService* local_state) {
false, false,
PrefService::UNSYNCABLE_PREF); PrefService::UNSYNCABLE_PREF);
} }
if (local_state->FindPreference(prefs::kScreenMagnifierEnabled) == NULL) {
local_state->RegisterBooleanPref(prefs::kScreenMagnifierEnabled,
false,
PrefService::UNSYNCABLE_PREF);
}
if (local_state->FindPreference(prefs::kVirtualKeyboardEnabled) == NULL) { if (local_state->FindPreference(prefs::kVirtualKeyboardEnabled) == NULL) {
local_state->RegisterBooleanPref(prefs::kVirtualKeyboardEnabled, local_state->RegisterBooleanPref(prefs::kVirtualKeyboardEnabled,
false, false,
......
...@@ -97,12 +97,16 @@ void Preferences::RegisterUserPrefs(PrefService* prefs) { ...@@ -97,12 +97,16 @@ void Preferences::RegisterUserPrefs(PrefService* prefs) {
false, false,
PrefService::UNSYNCABLE_PREF); PrefService::UNSYNCABLE_PREF);
} }
prefs->RegisterBooleanPref(prefs::kScreenMagnifierEnabled, if (prefs->FindPreference(prefs::kScreenMagnifierEnabled) == NULL) {
false, prefs->RegisterBooleanPref(prefs::kScreenMagnifierEnabled,
PrefService::UNSYNCABLE_PREF); false,
prefs->RegisterDoublePref(prefs::kScreenMagnifierScale, PrefService::UNSYNCABLE_PREF);
std::numeric_limits<double>::min(), }
PrefService::UNSYNCABLE_PREF); if (prefs->FindPreference(prefs::kScreenMagnifierScale) == NULL) {
prefs->RegisterDoublePref(prefs::kScreenMagnifierScale,
std::numeric_limits<double>::min(),
PrefService::UNSYNCABLE_PREF);
}
if (prefs->FindPreference(prefs::kVirtualKeyboardEnabled) == NULL) { if (prefs->FindPreference(prefs::kVirtualKeyboardEnabled) == NULL) {
prefs->RegisterBooleanPref(prefs::kVirtualKeyboardEnabled, prefs->RegisterBooleanPref(prefs::kVirtualKeyboardEnabled,
false, false,
...@@ -283,8 +287,6 @@ void Preferences::InitUserPrefs(PrefService* prefs) { ...@@ -283,8 +287,6 @@ void Preferences::InitUserPrefs(PrefService* prefs) {
prefs, this); prefs, this);
natural_scroll_.Init(prefs::kNaturalScroll, prefs, this); natural_scroll_.Init(prefs::kNaturalScroll, prefs, this);
accessibility_enabled_.Init(prefs::kSpokenFeedbackEnabled, prefs, this); accessibility_enabled_.Init(prefs::kSpokenFeedbackEnabled, prefs, this);
screen_magnifier_enabled_.Init(prefs::kScreenMagnifierEnabled, prefs, this);
screen_magnifier_scale_.Init(prefs::kScreenMagnifierScale, prefs, this);
mouse_sensitivity_.Init(prefs::kMouseSensitivity, prefs, this); mouse_sensitivity_.Init(prefs::kMouseSensitivity, prefs, this);
touchpad_sensitivity_.Init(prefs::kTouchpadSensitivity, prefs, this); touchpad_sensitivity_.Init(prefs::kTouchpadSensitivity, prefs, this);
use_24hour_clock_.Init(prefs::kUse24HourClock, prefs, this); use_24hour_clock_.Init(prefs::kUse24HourClock, prefs, this);
......
...@@ -102,8 +102,6 @@ class Preferences : public content::NotificationObserver { ...@@ -102,8 +102,6 @@ class Preferences : public content::NotificationObserver {
BooleanPrefMember natural_scroll_; BooleanPrefMember natural_scroll_;
BooleanPrefMember vert_edge_scroll_enabled_; BooleanPrefMember vert_edge_scroll_enabled_;
BooleanPrefMember accessibility_enabled_; BooleanPrefMember accessibility_enabled_;
BooleanPrefMember screen_magnifier_enabled_;
DoublePrefMember screen_magnifier_scale_;
IntegerPrefMember speed_factor_; IntegerPrefMember speed_factor_;
IntegerPrefMember mouse_sensitivity_; IntegerPrefMember mouse_sensitivity_;
IntegerPrefMember touchpad_sensitivity_; IntegerPrefMember touchpad_sensitivity_;
......
...@@ -1294,18 +1294,16 @@ void BrowserOptionsHandler::SetupAccessibilityFeatures() { ...@@ -1294,18 +1294,16 @@ void BrowserOptionsHandler::SetupAccessibilityFeatures() {
web_ui()->CallJavascriptFunction( web_ui()->CallJavascriptFunction(
"BrowserOptions.setHighContrastCheckboxState", "BrowserOptions.setHighContrastCheckboxState",
high_contrast_enabled); high_contrast_enabled);
base::FundamentalValue screen_magnifier_enabled(
pref_service->GetBoolean(prefs::kScreenMagnifierEnabled));
web_ui()->CallJavascriptFunction(
"BrowserOptions.setScreenMagnifierCheckboxState",
screen_magnifier_enabled);
base::FundamentalValue virtual_keyboard_enabled( base::FundamentalValue virtual_keyboard_enabled(
pref_service->GetBoolean(prefs::kVirtualKeyboardEnabled)); pref_service->GetBoolean(prefs::kVirtualKeyboardEnabled));
web_ui()->CallJavascriptFunction( web_ui()->CallJavascriptFunction(
"BrowserOptions.setVirtualKeyboardCheckboxState", "BrowserOptions.setVirtualKeyboardCheckboxState",
virtual_keyboard_enabled); virtual_keyboard_enabled);
PrefService* user_pref_service = Profile::FromWebUI(web_ui())->GetPrefs();
base::FundamentalValue screen_magnifier_enabled(
user_pref_service->GetBoolean(prefs::kScreenMagnifierEnabled));
web_ui()->CallJavascriptFunction(
"BrowserOptions.setScreenMagnifierCheckboxState",
screen_magnifier_enabled);
} }
#endif #endif
......
...@@ -115,8 +115,6 @@ ...@@ -115,8 +115,6 @@
# and mocks. # and mocks.
'browser/chromeos/accessibility/accessibility_util.cc', 'browser/chromeos/accessibility/accessibility_util.cc',
'browser/chromeos/accessibility/accessibility_util.h', 'browser/chromeos/accessibility/accessibility_util.h',
'browser/chromeos/accessibility/magnification_manager.cc',
'browser/chromeos/accessibility/magnification_manager.h',
'browser/chromeos/audio/audio_handler.cc', 'browser/chromeos/audio/audio_handler.cc',
'browser/chromeos/audio/audio_handler.h', 'browser/chromeos/audio/audio_handler.h',
'browser/chromeos/audio/audio_mixer.h', 'browser/chromeos/audio/audio_mixer.h',
......
...@@ -2787,7 +2787,6 @@ ...@@ -2787,7 +2787,6 @@
'browser/chrome_main_browsertest.cc', 'browser/chrome_main_browsertest.cc',
'browser/chrome_plugin_browsertest.cc', 'browser/chrome_plugin_browsertest.cc',
'browser/chrome_switches_browsertest.cc', 'browser/chrome_switches_browsertest.cc',
'browser/chromeos/accessibility/magnification_manager_browsertest.cc',
'browser/chromeos/bluetooth/test/mock_bluetooth_adapter.cc', 'browser/chromeos/bluetooth/test/mock_bluetooth_adapter.cc',
'browser/chromeos/bluetooth/test/mock_bluetooth_adapter.h', 'browser/chromeos/bluetooth/test/mock_bluetooth_adapter.h',
'browser/chromeos/bluetooth/test/mock_bluetooth_device.cc', 'browser/chromeos/bluetooth/test/mock_bluetooth_device.cc',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment