From 565328af78a242535ee0ffb4f3bbca7827382fb3 Mon Sep 17 00:00:00 2001 From: "wittman@chromium.org" Date: Fri, 14 Feb 2014 18:05:56 +0000 Subject: 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 --- ui/base/accelerators/accelerator.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'ui/base/accelerators') 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 { -- cgit v1.1