Index: chrome/installer/util/product_commands.h |
=================================================================== |
--- chrome/installer/util/product_commands.h (revision 0) |
+++ chrome/installer/util/product_commands.h (revision 0) |
@@ -0,0 +1,73 @@ |
+// Copyright (c) 2011 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_INSTALLER_UTIL_PRODUCT_COMMANDS_H_ |
+#define CHROME_INSTALLER_UTIL_PRODUCT_COMMANDS_H_ |
+#pragma once |
+ |
+#include <windows.h> |
+ |
+#include <map> |
+#include <string> |
+#include <utility> |
+ |
+#include "base/basictypes.h" |
+#include "chrome/installer/util/product_command.h" |
+ |
+class WorkItemList; |
+ |
+namespace base { |
+namespace win { |
+class RegKey; |
+} |
+} |
+ |
+namespace installer { |
+ |
+// A collection of ProductCommand objects. |
+class ProductCommands { |
+ public: |
+ typedef std::map<std::wstring, ProductCommand> CommandMap; |
+ typedef std::pair<CommandMap::const_iterator, CommandMap::const_iterator> |
+ CommandMapRange; |
+ |
+ ProductCommands(); |
+ ~ProductCommands(); |
+ |
+ // Initialize an instance from the set of commands in a given registry key |
+ // (typically a BrowserDistribution's "version key"). |
erikwright (departed)
2011/03/02 15:18:16
Update to reflect that it's "Commands" under ...
grt (UTC plus 2)
2011/03/02 19:48:28
Done.
|
+ bool Initialize(const base::win::RegKey& key); |
+ |
+ // Replaces the contents of this object with that of |other|. |
+ ProductCommands& CopyFrom(const ProductCommands& other); |
+ |
+ // Clears this instance. |
+ void Clear(); |
+ |
+ // Retrieves the command identified by |command_id| from the set, copying it |
+ // into |command| and returning true if present. |
+ bool Get(const std::wstring& command_id, ProductCommand* command) const; |
+ |
+ // Sets a command in the collection, adding it if it doesn't already exist. |
+ // Returns true if a new command is added; false if |command_id| was already |
+ // present and has been replaced with |command|. |
+ bool Set(const std::wstring& command_id, const ProductCommand& command); |
+ |
+ // Removes a command from the collection. Returns false if |command_id| was |
+ // not found. |
+ bool Remove(const std::wstring& command_id); |
+ |
+ // Returns a pair of STL iterators defining the range of objects in the |
+ // collection. |
+ CommandMapRange GetIterators() const; |
+ |
+ protected: |
+ CommandMap commands_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ProductCommands); |
+}; |
+ |
+} // namespace installer |
+ |
+#endif // CHROME_INSTALLER_UTIL_PRODUCT_COMMANDS_H_ |
Property changes on: chrome\installer\util\product_commands.h |
___________________________________________________________________ |
Added: svn:eol-style |
+ LF |