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

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

Issue 384423002: [Canceled] Extensions: Add install_flags parameter to ManagementPolicy::UserMayLoad (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update tests Created 6 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_EXTENSION_INSTALL_CHECKER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_CHECKER_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_CHECKER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_CHECKER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // will only be called once. 50 // will only be called once.
51 // This function must be called on the UI thread. The callback also occurs on 51 // This function must be called on the UI thread. The callback also occurs on
52 // the UI thread. Checks may run asynchronously in parallel. 52 // the UI thread. Checks may run asynchronously in parallel.
53 // If checks are currently running, the caller must wait for the callback to 53 // If checks are currently running, the caller must wait for the callback to
54 // be invoked before starting another set of checks. 54 // be invoked before starting another set of checks.
55 void Start(int enabled_checks, bool fail_fast, const Callback& callback); 55 void Start(int enabled_checks, bool fail_fast, const Callback& callback);
56 56
57 Profile* profile() const { return profile_; } 57 Profile* profile() const { return profile_; }
58 58
59 scoped_refptr<const Extension> extension() { return extension_; } 59 scoped_refptr<const Extension> extension() { return extension_; }
60 void set_extension(const Extension* extension) { extension_ = extension; } 60 void set_extension(const Extension* extension, int install_flags) {
61 extension_ = extension;
62 install_flags_ = install_flags;
63 }
61 64
62 // Returns true if any checks are currently running. 65 // Returns true if any checks are currently running.
63 bool is_running() const { return running_checks_ != 0; } 66 bool is_running() const { return running_checks_ != 0; }
64 67
65 // Returns the requirement violations. A non-empty list is considered to be 68 // Returns the requirement violations. A non-empty list is considered to be
66 // a check failure. 69 // a check failure.
67 const std::vector<std::string>& requirement_errors() const { 70 const std::vector<std::string>& requirement_errors() const {
68 return requirement_errors_; 71 return requirement_errors_;
69 } 72 }
70 73
(...skipping 23 matching lines...) Expand all
94 void MaybeInvokeCallback(); 97 void MaybeInvokeCallback();
95 98
96 scoped_ptr<RequirementsChecker> requirements_checker_; 99 scoped_ptr<RequirementsChecker> requirements_checker_;
97 100
98 // The Profile where the extension is being installed in. 101 // The Profile where the extension is being installed in.
99 Profile* profile_; 102 Profile* profile_;
100 103
101 // The extension to run checks for. 104 // The extension to run checks for.
102 scoped_refptr<const Extension> extension_; 105 scoped_refptr<const Extension> extension_;
103 106
107 int install_flags_;
108
104 // Requirement violations. 109 // Requirement violations.
105 std::vector<std::string> requirement_errors_; 110 std::vector<std::string> requirement_errors_;
106 111
107 // Result of the blacklist state check. 112 // Result of the blacklist state check.
108 BlacklistState blacklist_state_; 113 BlacklistState blacklist_state_;
109 114
110 // Whether the extension can be installed, according to management policies. 115 // Whether the extension can be installed, according to management policies.
111 bool policy_allows_load_; 116 bool policy_allows_load_;
112 std::string policy_error_; 117 std::string policy_error_;
113 118
(...skipping 10 matching lines...) Expand all
124 Callback callback_; 129 Callback callback_;
125 130
126 base::WeakPtrFactory<ExtensionInstallChecker> weak_ptr_factory_; 131 base::WeakPtrFactory<ExtensionInstallChecker> weak_ptr_factory_;
127 132
128 DISALLOW_COPY_AND_ASSIGN(ExtensionInstallChecker); 133 DISALLOW_COPY_AND_ASSIGN(ExtensionInstallChecker);
129 }; 134 };
130 135
131 } // namespace extensions 136 } // namespace extensions
132 137
133 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_CHECKER_H_ 138 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_CHECKER_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_error_controller.cc ('k') | chrome/browser/extensions/extension_install_checker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698