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

Side by Side Diff: chrome/browser/extensions/api/commands/command_service.h

Issue 180783012: Media Keys should not count towards the max of four shortcuts per extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move IsMediaKey from c/b/e/a/c/command_service.h &&.cc to c/c/e/command.h && .cc Created 6 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/commands/command_service.cc » ('j') | no next file with comments »
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_EXTENSIONS_API_COMMANDS_COMMAND_SERVICE_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_COMMANDS_COMMAND_SERVICE_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_COMMANDS_COMMAND_SERVICE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_COMMANDS_COMMAND_SERVICE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // Constructs a CommandService object for the given profile. 71 // Constructs a CommandService object for the given profile.
72 explicit CommandService(content::BrowserContext* context); 72 explicit CommandService(content::BrowserContext* context);
73 virtual ~CommandService(); 73 virtual ~CommandService();
74 74
75 // ProfileKeyedAPI implementation. 75 // ProfileKeyedAPI implementation.
76 static ProfileKeyedAPIFactory<CommandService>* GetFactoryInstance(); 76 static ProfileKeyedAPIFactory<CommandService>* GetFactoryInstance();
77 77
78 // Convenience method to get the CommandService for a profile. 78 // Convenience method to get the CommandService for a profile.
79 static CommandService* Get(content::BrowserContext* context); 79 static CommandService* Get(content::BrowserContext* context);
80 80
81 // Return true if the specified accelerator is one of the following multimedia
82 // keys: Next Track key, Previous Track key, Stop Media key, Play/Pause Media
83 // key, without any modifiers.
84 static bool IsMediaKey(const ui::Accelerator& accelerator);
85
86 // Returns true if |extension| is permitted to and does remove the bookmark 81 // Returns true if |extension| is permitted to and does remove the bookmark
87 // shortcut key. 82 // shortcut key.
88 static bool RemovesBookmarkShortcut(const extensions::Extension* extension); 83 static bool RemovesBookmarkShortcut(const extensions::Extension* extension);
89 84
90 // Gets the command (if any) for the browser action of an extension given 85 // Gets the command (if any) for the browser action of an extension given
91 // its |extension_id|. The function consults the master list to see if 86 // its |extension_id|. The function consults the master list to see if
92 // the command is active. Returns false if the extension has no browser 87 // the command is active. Returns false if the extension has no browser
93 // action. Returns false if the command is not active and |type| requested 88 // action. Returns false if the command is not active and |type| requested
94 // is ACTIVE_ONLY. |command| contains the command found and |active| (if not 89 // is ACTIVE_ONLY. |command| contains the command found and |active| (if not
95 // NULL) contains whether |command| is active. 90 // NULL) contains whether |command| is active.
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 201
207 DISALLOW_COPY_AND_ASSIGN(CommandService); 202 DISALLOW_COPY_AND_ASSIGN(CommandService);
208 }; 203 };
209 204
210 template <> 205 template <>
211 void ProfileKeyedAPIFactory<CommandService>::DeclareFactoryDependencies(); 206 void ProfileKeyedAPIFactory<CommandService>::DeclareFactoryDependencies();
212 207
213 } // namespace extensions 208 } // namespace extensions
214 209
215 #endif // CHROME_BROWSER_EXTENSIONS_API_COMMANDS_COMMAND_SERVICE_H_ 210 #endif // CHROME_BROWSER_EXTENSIONS_API_COMMANDS_COMMAND_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/commands/command_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698