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_EXTERNAL_INSTALL_ERROR_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTERNAL_INSTALL_ERROR_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_INSTALL_ERROR_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_INSTALL_ERROR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "chrome/browser/extensions/extension_install_prompt.h" | 13 #include "chrome/browser/extensions/extension_install_prompt.h" |
14 #include "chrome/browser/extensions/webstore_data_fetcher_delegate.h" | 14 #include "chrome/browser/extensions/webstore_data_fetcher_delegate.h" |
15 | 15 |
16 class Browser; | 16 class Browser; |
17 class ExtensionInstallPromptShowParams; | |
18 class ExtensionInstallUI; | 17 class ExtensionInstallUI; |
19 class GlobalError; | 18 class GlobalError; |
20 class GlobalErrorService; | 19 class GlobalErrorService; |
21 | 20 |
22 namespace content { | 21 namespace content { |
23 class BrowserContext; | 22 class BrowserContext; |
24 } | 23 } |
25 | 24 |
26 namespace extensions { | 25 namespace extensions { |
27 class Extension; | 26 class Extension; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 void OnWebstoreRequestFailure() override; | 69 void OnWebstoreRequestFailure() override; |
71 void OnWebstoreResponseParseSuccess( | 70 void OnWebstoreResponseParseSuccess( |
72 scoped_ptr<base::DictionaryValue> webstore_data) override; | 71 scoped_ptr<base::DictionaryValue> webstore_data) override; |
73 void OnWebstoreResponseParseFailure(const std::string& error) override; | 72 void OnWebstoreResponseParseFailure(const std::string& error) override; |
74 | 73 |
75 // Called when data fetching has completed (either successfully or not). | 74 // Called when data fetching has completed (either successfully or not). |
76 void OnFetchComplete(); | 75 void OnFetchComplete(); |
77 | 76 |
78 // Called when the dialog has been successfully populated, and is ready to be | 77 // Called when the dialog has been successfully populated, and is ready to be |
79 // shown. | 78 // shown. |
80 void OnDialogReady(ExtensionInstallPromptShowParams* show_params, | 79 void OnDialogReady(const ExtensionInstallPrompt::ShowParams& show_params, |
81 ExtensionInstallPrompt::Delegate* prompt_delegate, | 80 ExtensionInstallPrompt::Delegate* prompt_delegate, |
82 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt); | 81 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt); |
83 | 82 |
84 // The associated BrowserContext. | 83 // The associated BrowserContext. |
85 content::BrowserContext* browser_context_; | 84 content::BrowserContext* browser_context_; |
86 | 85 |
87 // The id of the external extension. | 86 // The id of the external extension. |
88 std::string extension_id_; | 87 std::string extension_id_; |
89 | 88 |
90 // The type of alert to show the user. | 89 // The type of alert to show the user. |
91 AlertType alert_type_; | 90 AlertType alert_type_; |
92 | 91 |
93 // The owning ExternalInstallManager. | 92 // The owning ExternalInstallManager. |
94 ExternalInstallManager* manager_; | 93 ExternalInstallManager* manager_; |
95 | 94 |
96 // The associated GlobalErrorService. | 95 // The associated GlobalErrorService. |
97 GlobalErrorService* error_service_; | 96 GlobalErrorService* error_service_; |
98 | 97 |
99 // The UI for showing the error. | 98 // The UI for showing the error. |
100 scoped_ptr<ExtensionInstallPrompt> install_ui_; | 99 scoped_ptr<ExtensionInstallPrompt> install_ui_; |
101 scoped_ptr<ExtensionInstallPromptShowParams> install_ui_show_params_; | |
102 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt_; | 100 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt_; |
103 | 101 |
104 // The UI for the given error, which will take the form of either a menu | 102 // The UI for the given error, which will take the form of either a menu |
105 // alert or a bubble alert (depending on the |alert_type_|. | 103 // alert or a bubble alert (depending on the |alert_type_|. |
106 scoped_ptr<GlobalError> global_error_; | 104 scoped_ptr<GlobalError> global_error_; |
107 | 105 |
108 // The WebstoreDataFetcher to use in order to populate the error with webstore | 106 // The WebstoreDataFetcher to use in order to populate the error with webstore |
109 // information of the extension. | 107 // information of the extension. |
110 scoped_ptr<WebstoreDataFetcher> webstore_data_fetcher_; | 108 scoped_ptr<WebstoreDataFetcher> webstore_data_fetcher_; |
111 | 109 |
112 base::WeakPtrFactory<ExternalInstallError> weak_factory_; | 110 base::WeakPtrFactory<ExternalInstallError> weak_factory_; |
113 | 111 |
114 DISALLOW_COPY_AND_ASSIGN(ExternalInstallError); | 112 DISALLOW_COPY_AND_ASSIGN(ExternalInstallError); |
115 }; | 113 }; |
116 | 114 |
117 } // namespace extensions | 115 } // namespace extensions |
118 | 116 |
119 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_INSTALL_ERROR_H_ | 117 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_INSTALL_ERROR_H_ |
OLD | NEW |