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

Unified Diff: chrome/common/extensions/extension_commands.h

Issue 10317014: Move Command class out of the Extension class and into its own location (under chrome/common/exten… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 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/common/extensions/extension.cc ('k') | chrome/common/extensions/extension_commands.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension_commands.h
===================================================================
--- chrome/common/extensions/extension_commands.h (revision 0)
+++ chrome/common/extensions/extension_commands.h (revision 0)
@@ -0,0 +1,56 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_COMMANDS_H_
+#define CHROME_COMMON_EXTENSIONS_EXTENSION_COMMANDS_H_
+#pragma once
+
+#include <string>
+#include <map>
+
+#include "base/string16.h"
+#include "ui/base/accelerators/accelerator.h"
+
+namespace base {
+class DictionaryValue;
+}
+
+namespace extensions {
+
+class Command {
+ public:
+ // Define out of line constructor/destructor to please Clang.
+ Command();
+ ~Command();
+
+ // The platform value for the Command.
+ static std::string CommandPlatform();
+
+ // Parse the command.
+ bool Parse(base::DictionaryValue* command,
+ const std::string& command_name,
+ int index,
+ string16* error);
+
+ // Accessors:
+ const std::string& command_name() const { return command_name_; }
+ const ui::Accelerator& accelerator() const { return accelerator_; }
+ const std::string& description() const { return description_; }
+
+ private:
+ ui::Accelerator ParseImpl(const std::string& shortcut,
+ const std::string& platform_key,
+ int index,
+ string16* error);
+ std::string command_name_;
+ ui::Accelerator accelerator_;
+ std::string description_;
+};
+
+// A mapping of command name (std::string) to a command object.
+typedef std::map<std::string, Command> CommandMap;
+
+}
Jói 2012/05/04 13:26:40 I think our coding standard says this should shoul
+
+#endif // CHROME_COMMON_EXTENSIONS_EXTENSION_COMMANDS_H_
Property changes on: chrome\common\extensions\extension_commands.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/common/extensions/extension_commands.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698