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

Unified Diff: chrome/installer/util/product_commands.h

Issue 6588003: Add support for the quick-enable-cf command to the installer. This encompase... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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
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

Powered by Google App Engine
This is Rietveld 408576698