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