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

Unified Diff: chrome/installer/util/app_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
« no previous file with comments | « chrome/installer/util/app_command.cc ('k') | chrome/installer/util/app_commands.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/app_commands.h
===================================================================
--- chrome/installer/util/app_commands.h (revision 0)
+++ chrome/installer/util/app_commands.h (revision 0)
@@ -0,0 +1,75 @@
+// 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_APP_COMMANDS_H_
+#define CHROME_INSTALLER_UTIL_APP_COMMANDS_H_
+#pragma once
+
+#include <windows.h>
+
+#include <map>
+#include <string>
+#include <utility>
+
+#include "base/basictypes.h"
+#include "chrome/installer/util/app_command.h"
+
+class WorkItemList;
+
+namespace base {
+namespace win {
+class RegKey;
+}
+}
+
+namespace installer {
+
+// A collection of AppCommand objects.
+class AppCommands {
+ public:
+ typedef std::map<std::wstring, AppCommand> CommandMap;
+ typedef std::pair<CommandMap::const_iterator, CommandMap::const_iterator>
+ CommandMapRange;
+
+ AppCommands();
+ ~AppCommands();
+
+ // Initialize an instance from the set of commands in a given registry key
+ // (typically the "Commands" subkey of a BrowserDistribution's "version key").
+ // |key| must have been opened with at least
+ // KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE access rights.
+ bool Initialize(const base::win::RegKey& key);
+
+ // Replaces the contents of this object with that of |other|.
+ AppCommands& CopyFrom(const AppCommands& 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, AppCommand* 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 AppCommand& 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(AppCommands);
+};
+
+} // namespace installer
+
+#endif // CHROME_INSTALLER_UTIL_APP_COMMANDS_H_
Property changes on: chrome\installer\util\app_commands.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/installer/util/app_command.cc ('k') | chrome/installer/util/app_commands.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698