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

Side by Side Diff: chrome/browser/command_updater.cc

Issue 765043002: Bookmark pop-up doesn't open if Ctrl+D is set as keyboard shortcut for added extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing nit. Created 6 years 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/command_updater.h" 5 #include "chrome/browser/command_updater.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/observer_list.h" 10 #include "base/observer_list.h"
11 #include "base/stl_util.h" 11 #include "base/stl_util.h"
12 #include "chrome/browser/command_observer.h" 12 #include "chrome/browser/command_observer.h"
13 #include "chrome/browser/command_updater_delegate.h" 13 #include "chrome/browser/command_updater_delegate.h"
14 14
15 class CommandUpdater::Command { 15 class CommandUpdater::Command {
16 public: 16 public:
17 bool enabled; 17 bool enabled;
18 ObserverList<CommandObserver> observers; 18 ObserverList<CommandObserver> observers;
19 19
20 Command() : enabled(true) {} 20 Command() : enabled(true) {}
21 }; 21 };
22 22
23 CommandUpdater::CommandUpdater(CommandUpdaterDelegate* delegate) 23 CommandUpdater::CommandUpdater(CommandUpdaterDelegate* delegate)
24 : delegate_(delegate) { 24 : delegate_(delegate), bookmark_icon_selection_(false) {
25 } 25 }
26 26
27 CommandUpdater::~CommandUpdater() { 27 CommandUpdater::~CommandUpdater() {
28 STLDeleteContainerPairSecondPointers(commands_.begin(), commands_.end()); 28 STLDeleteContainerPairSecondPointers(commands_.begin(), commands_.end());
29 } 29 }
30 30
31 bool CommandUpdater::SupportsCommand(int id) const { 31 bool CommandUpdater::SupportsCommand(int id) const {
32 return commands_.find(id) != commands_.end(); 32 return commands_.find(id) != commands_.end();
33 } 33 }
34 34
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 CommandUpdater::Command* CommandUpdater::GetCommand(int id, bool create) { 83 CommandUpdater::Command* CommandUpdater::GetCommand(int id, bool create) {
84 bool supported = SupportsCommand(id); 84 bool supported = SupportsCommand(id);
85 if (supported) 85 if (supported)
86 return commands_[id]; 86 return commands_[id];
87 DCHECK(create); 87 DCHECK(create);
88 Command* command = new Command; 88 Command* command = new Command;
89 commands_[id] = command; 89 commands_[id] = command;
90 return command; 90 return command;
91 } 91 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698