diff options
author | wittman@chromium.org <wittman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-14 18:05:56 +0000 |
---|---|---|
committer | wittman@chromium.org <wittman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-14 18:05:56 +0000 |
commit | 565328af78a242535ee0ffb4f3bbca7827382fb3 (patch) | |
tree | 24024c00f2175bbb67a9260116728ae6b5f55ec9 /ui/base/accelerators | |
parent | fee444af2854cb3693915c1fbe7f2c749be43e73 (diff) | |
download | chromium_src-565328af78a242535ee0ffb4f3bbca7827382fb3.zip chromium_src-565328af78a242535ee0ffb4f3bbca7827382fb3.tar.gz chromium_src-565328af78a242535ee0ffb4f3bbca7827382fb3.tar.bz2 |
Allow extensions to remove and override the bookmark shortcut key
This feature is enabled for dev behind the
--enable-override-bookmarks-ui=1 feature flag, and for all releases for
internal bookmarks extensions.
Implements the shortcut key aspect of the
Remove Bookmark Shortcut Chrome API proposal:
https://docs.google.com/a/chromium.org/document/d/1C2Mle92O9uGlji5y5gGDM5tNJ_tVE1Vb-2xgsZPNDTk
BUG=335655
R=erg@chromium.org, finnur@chromium.org, shess@chromium.org, sky@chromium.org
Review URL: https://codereview.chromium.org/143493005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251368 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base/accelerators')
-rw-r--r-- | ui/base/accelerators/accelerator.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/ui/base/accelerators/accelerator.cc b/ui/base/accelerators/accelerator.cc index de3cbf2..9d6ffa7 100644 --- a/ui/base/accelerators/accelerator.cc +++ b/ui/base/accelerators/accelerator.cc @@ -68,14 +68,15 @@ bool Accelerator::operator <(const Accelerator& rhs) const { } bool Accelerator::operator ==(const Accelerator& rhs) const { - if (platform_accelerator_.get() != rhs.platform_accelerator_.get() && - ((!platform_accelerator_.get() || !rhs.platform_accelerator_.get()) || - !platform_accelerator_->Equals(*rhs.platform_accelerator_))) { - return false; - } + if ((key_code_ == rhs.key_code_) && (type_ == rhs.type_) && + (modifiers_ == rhs.modifiers_)) + return true; + + bool platform_equal = + platform_accelerator_.get() && rhs.platform_accelerator_.get() && + platform_accelerator_.get() == rhs.platform_accelerator_.get(); - return (key_code_ == rhs.key_code_) && (type_ == rhs.type_) && - (modifiers_ == rhs.modifiers_); + return platform_equal; } bool Accelerator::operator !=(const Accelerator& rhs) const { |