diff options
author | yoshiki@chromium.org <yoshiki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-06 04:34:01 +0000 |
---|---|---|
committer | yoshiki@chromium.org <yoshiki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-06 04:34:01 +0000 |
commit | ce464bf730dc151f843740626acc659cf19b54d4 (patch) | |
tree | 39f1e8ce3fd58775b4b388070061fd1e493db4af /ash/magnifier | |
parent | 32937f8ba094dd9b08ae92e136e39d3c14416ce5 (diff) | |
download | chromium_src-ce464bf730dc151f843740626acc659cf19b54d4.zip chromium_src-ce464bf730dc151f843740626acc659cf19b54d4.tar.gz chromium_src-ce464bf730dc151f843740626acc659cf19b54d4.tar.bz2 |
Magnifier: Prevent useless operation in enabling/disabling magnifier.
On login, although the magnifier is disabled, the manager/controller try to disable it again. This CL prevents this useless operation.
Changes:
- In MagnificationManager::SetMagnifier(), if the given type is same as the current type, do nothing.
- In MagnificationControllerImpl::SetEnabled(), if the given |enabled| is same as current, do nothing.
- Use Initialize/Shutdown pattern instead of scoped_ptr in ChromeBrowserMainPartsChromeos.
- Initialize in PreProfileInit() instead of PostProfileInit().
- Add MagnificationObserver, and use it instead of watching pref changes.
- GetMagnifierType() returns the cached value.
BUG=163941
TEST=manual, browser_tests passes
Review URL: https://codereview.chromium.org/11280287
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171401 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/magnifier')
-rw-r--r-- | ash/magnifier/magnification_controller.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ash/magnifier/magnification_controller.cc b/ash/magnifier/magnification_controller.cc index d2169b3..1cbc56a 100644 --- a/ash/magnifier/magnification_controller.cc +++ b/ash/magnifier/magnification_controller.cc @@ -472,6 +472,9 @@ void MagnificationControllerImpl::EnsurePointIsVisible( } void MagnificationControllerImpl::SetEnabled(bool enabled) { + if (enabled == is_enabled_) + return; + if (enabled) { float scale = ash::Shell::GetInstance()->delegate()->GetSavedScreenMagnifierScale(); |