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

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

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
« no previous file with comments | « no previous file | chrome/browser/command_updater.cc » ('j') | chrome/browser/ui/browser_commands.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CHROME_BROWSER_COMMAND_UPDATER_H_ 5 #ifndef CHROME_BROWSER_COMMAND_UPDATER_H_
6 #define CHROME_BROWSER_COMMAND_UPDATER_H_ 6 #define CHROME_BROWSER_COMMAND_UPDATER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "ui/base/window_open_disposition.h" 10 #include "ui/base/window_open_disposition.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 // Removes |observer| for all commands on which it's registered. 56 // Removes |observer| for all commands on which it's registered.
57 void RemoveCommandObserver(CommandObserver* observer); 57 void RemoveCommandObserver(CommandObserver* observer);
58 58
59 // Notify all observers of a particular command that the command has been 59 // Notify all observers of a particular command that the command has been
60 // enabled or disabled. If the command does not exist, it is created and 60 // enabled or disabled. If the command does not exist, it is created and
61 // initialized to |state|. This function is very lightweight if the command 61 // initialized to |state|. This function is very lightweight if the command
62 // state has not changed. 62 // state has not changed.
63 void UpdateCommandEnabled(int id, bool state); 63 void UpdateCommandEnabled(int id, bool state);
64 64
65 // Set status for bookmark icon selection.
66 void set_bookmark_icon_selected(bool selection) {
67 bookmark_icon_selection_ = selection;
68 }
69
70 // Returns the status of bookmark icon selection.
71 bool get_bookmark_icon_selected() { return bookmark_icon_selection_; }
72
65 private: 73 private:
66 // A piece of data about a command - whether or not it is enabled, and a list 74 // A piece of data about a command - whether or not it is enabled, and a list
67 // of objects that observe the enabled state of this command. 75 // of objects that observe the enabled state of this command.
68 class Command; 76 class Command;
69 77
70 // Get a Command node for a given command ID, creating an entry if it doesn't 78 // Get a Command node for a given command ID, creating an entry if it doesn't
71 // exist if desired. 79 // exist if desired.
72 Command* GetCommand(int id, bool create); 80 Command* GetCommand(int id, bool create);
73 81
74 // The delegate is responsible for executing commands. 82 // The delegate is responsible for executing commands.
75 CommandUpdaterDelegate* delegate_; 83 CommandUpdaterDelegate* delegate_;
76 84
77 // This is a map of command IDs to states and observer lists 85 // This is a map of command IDs to states and observer lists
78 typedef base::hash_map<int, Command*> CommandMap; 86 typedef base::hash_map<int, Command*> CommandMap;
79 CommandMap commands_; 87 CommandMap commands_;
80 88
89 // Keep status of bookmark icon selection.
90 bool bookmark_icon_selection_;
91
81 DISALLOW_COPY_AND_ASSIGN(CommandUpdater); 92 DISALLOW_COPY_AND_ASSIGN(CommandUpdater);
82 }; 93 };
83 94
84 #endif // CHROME_BROWSER_COMMAND_UPDATER_H_ 95 #endif // CHROME_BROWSER_COMMAND_UPDATER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/command_updater.cc » ('j') | chrome/browser/ui/browser_commands.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698