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

Side by Side Diff: chrome/browser/ui/intents/web_intent_picker_model.h

Issue 11035017: Mac Web Intents Part 15: Inline extension install prompt (model) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_UI_INTENTS_WEB_INTENT_PICKER_MODEL_H_ 5 #ifndef CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_MODEL_H_
6 #define CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_MODEL_H_ 6 #define CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_MODEL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/string16.h" 11 #include "base/string16.h"
12 #include "chrome/browser/extensions/extension_install_prompt.h"
12 #include "googleurl/src/gurl.h" 13 #include "googleurl/src/gurl.h"
13 #include "ui/gfx/image/image.h" 14 #include "ui/gfx/image/image.h"
14 #include "webkit/glue/web_intent_service_data.h" 15 #include "webkit/glue/web_intent_service_data.h"
15 16
16 class WebIntentPickerModelObserver; 17 class WebIntentPickerModelObserver;
17 18
18 // Model for the WebIntentPicker. 19 // Model for the WebIntentPicker.
19 class WebIntentPickerModel { 20 class WebIntentPickerModel {
20 public: 21 public:
21 // An intent service to display in the picker. 22 // An intent service to display in the picker.
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 } 166 }
166 167
167 // Sets the status of extension install process. 168 // Sets the status of extension install process.
168 void SetPendingInstallStatusString(const string16& status); 169 void SetPendingInstallStatusString(const string16& status);
169 170
170 // Gets the status of extension install process. 171 // Gets the status of extension install process.
171 const string16& pending_install_status_string() const { 172 const string16& pending_install_status_string() const {
172 return pending_install_status_string_; 173 return pending_install_status_string_;
173 } 174 }
174 175
176 // Sets the extension install delegate.
177 void SetPendingInstallDelegate(ExtensionInstallPrompt::Delegate* delegate);
178
179 // Gets the extension install delegate.
180 ExtensionInstallPrompt::Delegate* pending_install_delegate() const {
181 return pending_install_delegate_;
182 }
183
184 // Sets the extension install prompt.
185 void SetPendingInstallPrompt(const ExtensionInstallPrompt::Prompt& prompt);
186
187 // Gets the extension install prompt.
188 const ExtensionInstallPrompt::Prompt* pending_install_prompt() const {
189 return pending_install_prompt_.get();
190 }
191
175 // Removes any pending extension install state. 192 // Removes any pending extension install state.
176 void ClearPendingInstall(); 193 void ClearPendingInstall();
177 194
178 private: 195 private:
179 // Delete all elements in |installed_services_| and |suggested_extensions_|. 196 // Delete all elements in |installed_services_| and |suggested_extensions_|.
180 // Note that this method does not reset the observer. 197 // Note that this method does not reset the observer.
181 void DestroyAll(); 198 void DestroyAll();
182 199
183 // A vector of all installed services in the picker. Each installed service 200 // A vector of all installed services in the picker. Each installed service
184 // is owned by this model. 201 // is owned by this model.
(...skipping 22 matching lines...) Expand all
207 // Indicates that there are still open requests to CWS. 224 // Indicates that there are still open requests to CWS.
208 bool waiting_for_suggestions_; 225 bool waiting_for_suggestions_;
209 226
210 // The hash context for the default service, if there is one. 227 // The hash context for the default service, if there is one.
211 int64 default_service_hash_; 228 int64 default_service_hash_;
212 229
213 // Information about the pending extension install. 230 // Information about the pending extension install.
214 std::string pending_install_extension_id_; 231 std::string pending_install_extension_id_;
215 int pending_install_download_percent_; 232 int pending_install_download_percent_;
216 string16 pending_install_status_string_; 233 string16 pending_install_status_string_;
234 ExtensionInstallPrompt::Delegate* pending_install_delegate_;
235 scoped_ptr<ExtensionInstallPrompt::Prompt> pending_install_prompt_;
217 236
218 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerModel); 237 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerModel);
219 }; 238 };
220 239
221 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_MODEL_H_ 240 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698