OLD | NEW |
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // Otherwise it will be invoked when all checks have completed. |callback| | 49 // Otherwise it will be invoked when all checks have completed. |callback| |
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 const scoped_refptr<const Extension>& extension() { return extension_; } |
60 void set_extension(const Extension* extension) { extension_ = extension; } | 60 void set_extension(const scoped_refptr<const Extension>& extension) { |
| 61 extension_ = extension; |
| 62 } |
61 | 63 |
62 // Returns true if any checks are currently running. | 64 // Returns true if any checks are currently running. |
63 bool is_running() const { return running_checks_ != 0; } | 65 bool is_running() const { return running_checks_ != 0; } |
64 | 66 |
65 // Returns the requirement violations. A non-empty list is considered to be | 67 // Returns the requirement violations. A non-empty list is considered to be |
66 // a check failure. | 68 // a check failure. |
67 const std::vector<std::string>& requirement_errors() const { | 69 const std::vector<std::string>& requirement_errors() const { |
68 return requirement_errors_; | 70 return requirement_errors_; |
69 } | 71 } |
70 | 72 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 Callback callback_; | 126 Callback callback_; |
125 | 127 |
126 base::WeakPtrFactory<ExtensionInstallChecker> weak_ptr_factory_; | 128 base::WeakPtrFactory<ExtensionInstallChecker> weak_ptr_factory_; |
127 | 129 |
128 DISALLOW_COPY_AND_ASSIGN(ExtensionInstallChecker); | 130 DISALLOW_COPY_AND_ASSIGN(ExtensionInstallChecker); |
129 }; | 131 }; |
130 | 132 |
131 } // namespace extensions | 133 } // namespace extensions |
132 | 134 |
133 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_CHECKER_H_ | 135 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_CHECKER_H_ |
OLD | NEW |