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

Unified Diff: ui/base/accelerators/accelerator.cc

Issue 143493005: Allow extensions to remove and override the bookmark shortcut key (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update mac test fix Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/extensions/api_test/keybinding/overwrite_bookmark_shortcut/manifest.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/accelerators/accelerator.cc
diff --git a/ui/base/accelerators/accelerator.cc b/ui/base/accelerators/accelerator.cc
index de3cbf2e64a92d4fdbf1c2cc4f89f9ebd45d502e..9d6ffa72612c262ff3236024f527efbbd16dd416 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 {
« no previous file with comments | « chrome/test/data/extensions/api_test/keybinding/overwrite_bookmark_shortcut/manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698