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

Side by Side Diff: chrome/browser/extensions/pending_extension_manager.h

Issue 7605001: Extensions installed by policy overrun previously installed extensions. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: More tests. Created 9 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_PENDING_EXTENSION_MANAGER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_PENDING_EXTENSION_MANAGER_H_
6 #define CHROME_BROWSER_EXTENSIONS_PENDING_EXTENSION_MANAGER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_PENDING_EXTENSION_MANAGER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // TODO(akalin): Replace |install_silently| with a list of 65 // TODO(akalin): Replace |install_silently| with a list of
66 // pre-enabled permissions. 66 // pre-enabled permissions.
67 bool AddFromSync( 67 bool AddFromSync(
68 const std::string& id, 68 const std::string& id,
69 const GURL& update_url, 69 const GURL& update_url,
70 PendingExtensionInfo::ShouldAllowInstallPredicate should_allow_install, 70 PendingExtensionInfo::ShouldAllowInstallPredicate should_allow_install,
71 bool install_silently); 71 bool install_silently);
72 72
73 // Given an extension id and an update URL, schedule the extension 73 // Given an extension id and an update URL, schedule the extension
74 // to be fetched, installed, and activated. 74 // to be fetched, installed, and activated.
75 // If |overwrite| is true, an existing extension with the same id will
76 // be replaced by the extension fetched.
75 void AddFromExternalUpdateUrl(const std::string& id, 77 void AddFromExternalUpdateUrl(const std::string& id,
76 const GURL& update_url, 78 const GURL& update_url,
77 Extension::Location location); 79 Extension::Location location,
80 bool overwrite);
78 81
79 // Add a pending extension record for an external CRX file. 82 // Add a pending extension record for an external CRX file.
80 void AddFromExternalFile( 83 void AddFromExternalFile(
81 const std::string& id, 84 const std::string& id,
82 Extension::Location location); 85 Extension::Location location);
83 86
84 private: 87 private:
85 // Assumes an extension with id |id| is not already installed. 88 // Assumes an extension with id |id| is not already installed.
86 // Return true if the extension was added. 89 // Return true if the extension was added.
87 bool AddExtensionImpl( 90 bool AddExtensionImpl(
(...skipping 23 matching lines...) Expand all
111 UpdatePendingExtensionAlreadyInstalled); 114 UpdatePendingExtensionAlreadyInstalled);
112 friend class ExtensionUpdaterTest; 115 friend class ExtensionUpdaterTest;
113 friend void SetupPendingExtensionManagerForTest( 116 friend void SetupPendingExtensionManagerForTest(
114 int count, const GURL& update_url, 117 int count, const GURL& update_url,
115 PendingExtensionManager* pending_extension_manager); 118 PendingExtensionManager* pending_extension_manager);
116 119
117 DISALLOW_COPY_AND_ASSIGN(PendingExtensionManager); 120 DISALLOW_COPY_AND_ASSIGN(PendingExtensionManager);
118 }; 121 };
119 122
120 #endif // CHROME_BROWSER_EXTENSIONS_PENDING_EXTENSION_MANAGER_H_ 123 #endif // CHROME_BROWSER_EXTENSIONS_PENDING_EXTENSION_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698