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

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

Issue 11087071: Making ShowExtensionInstallDialog a callback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review comments 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_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/string16.h" 13 #include "base/string16.h"
14 #include "chrome/browser/extensions/crx_installer_error.h" 14 #include "chrome/browser/extensions/crx_installer_error.h"
15 #include "chrome/browser/extensions/image_loading_tracker.h" 15 #include "chrome/browser/extensions/image_loading_tracker.h"
16 #include "chrome/common/extensions/url_pattern.h" 16 #include "chrome/common/extensions/url_pattern.h"
17 #include "google_apis/gaia/oauth2_mint_token_flow.h" 17 #include "google_apis/gaia/oauth2_mint_token_flow.h"
18 #include "third_party/skia/include/core/SkBitmap.h" 18 #include "third_party/skia/include/core/SkBitmap.h"
19 #include "ui/gfx/image/image.h" 19 #include "ui/gfx/image/image.h"
20 #include "ui/gfx/image/image_skia.h" 20 #include "ui/gfx/image/image_skia.h"
21 #include "ui/gfx/native_widget_types.h" 21 #include "ui/gfx/native_widget_types.h"
22 22
23 class Browser; 23 class Browser;
24 class ExtensionInstallDialog;
24 class ExtensionInstallUI; 25 class ExtensionInstallUI;
25 class InfoBarDelegate; 26 class InfoBarDelegate;
26 class MessageLoop; 27 class MessageLoop;
27 class Profile; 28 class Profile;
28 29
29 namespace base { 30 namespace base {
30 class DictionaryValue; 31 class DictionaryValue;
31 } // namespace base 32 } // namespace base
32 33
33 namespace content { 34 namespace content {
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 // This is called by the standalone installer to verify whether the install 190 // This is called by the standalone installer to verify whether the install
190 // from the webstore should proceed. 191 // from the webstore should proceed.
191 // 192 //
192 // We *MUST* eventually call either Proceed() or Abort() on |delegate|. 193 // We *MUST* eventually call either Proceed() or Abort() on |delegate|.
193 virtual void ConfirmStandaloneInstall(Delegate* delegate, 194 virtual void ConfirmStandaloneInstall(Delegate* delegate,
194 const extensions::Extension* extension, 195 const extensions::Extension* extension,
195 SkBitmap* icon, 196 SkBitmap* icon,
196 const Prompt& prompt); 197 const Prompt& prompt);
197 198
198 // This is called by the installer to verify whether the installation from 199 // This is called by the installer to verify whether the installation from
199 // the webstore should proceed. 200 // the webstore should proceed. |dialog| is optional and can be NULL.
200 // 201 //
201 // We *MUST* eventually call either Proceed() or Abort() on |delegate|. 202 // We *MUST* eventually call either Proceed() or Abort() on |delegate|.
202 virtual void ConfirmWebstoreInstall(Delegate* delegate, 203 virtual void ConfirmWebstoreInstall(
203 const extensions::Extension* extension, 204 Delegate* delegate,
204 const SkBitmap* icon); 205 const extensions::Extension* extension,
206 const SkBitmap* icon,
207 scoped_refptr<ExtensionInstallDialog> dialog);
205 208
206 // This is called by the installer to verify whether the installation should 209 // This is called by the installer to verify whether the installation should
207 // proceed. This is declared virtual for testing. 210 // proceed. This is declared virtual for testing. |dialog| is optional and
211 // can be NULL.
208 // 212 //
209 // We *MUST* eventually call either Proceed() or Abort() on |delegate|. 213 // We *MUST* eventually call either Proceed() or Abort() on |delegate|.
210 virtual void ConfirmInstall(Delegate* delegate, 214 virtual void ConfirmInstall(Delegate* delegate,
211 const extensions::Extension* extension); 215 const extensions::Extension* extension,
216 scoped_refptr<ExtensionInstallDialog> dialog);
212 217
213 // This is called by the app handler launcher to verify whether the app 218 // This is called by the app handler launcher to verify whether the app
214 // should be re-enabled. This is declared virtual for testing. 219 // should be re-enabled. This is declared virtual for testing.
215 // 220 //
216 // We *MUST* eventually call either Proceed() or Abort() on |delegate|. 221 // We *MUST* eventually call either Proceed() or Abort() on |delegate|.
217 virtual void ConfirmReEnable(Delegate* delegate, 222 virtual void ConfirmReEnable(Delegate* delegate,
218 const extensions::Extension* extension); 223 const extensions::Extension* extension);
219 224
220 // This is called by the extension permissions API to verify whether an 225 // This is called by the extension permissions API to verify whether an
221 // extension may be granted additional permissions. 226 // extension may be granted additional permissions.
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 Prompt prompt_; 309 Prompt prompt_;
305 310
306 // The type of prompt we are going to show. 311 // The type of prompt we are going to show.
307 PromptType prompt_type_; 312 PromptType prompt_type_;
308 313
309 scoped_ptr<OAuth2MintTokenFlow> token_flow_; 314 scoped_ptr<OAuth2MintTokenFlow> token_flow_;
310 315
311 // Keeps track of extension images being loaded on the File thread for the 316 // Keeps track of extension images being loaded on the File thread for the
312 // purpose of showing the install UI. 317 // purpose of showing the install UI.
313 ImageLoadingTracker tracker_; 318 ImageLoadingTracker tracker_;
319
320 // Used to show the confirm dialog.
321 scoped_refptr<ExtensionInstallDialog> dialog_;
314 }; 322 };
315 323
316 namespace chrome { 324 namespace chrome {
317 325
318 // Creates an ExtensionInstallPrompt from |browser|. Caller assumes ownership. 326 // Creates an ExtensionInstallPrompt from |browser|. Caller assumes ownership.
319 // TODO(beng): remove this once various extensions types are weaned from 327 // TODO(beng): remove this once various extensions types are weaned from
320 // Browser. 328 // Browser.
321 ExtensionInstallPrompt* CreateExtensionInstallPromptWithBrowser( 329 ExtensionInstallPrompt* CreateExtensionInstallPromptWithBrowser(
322 Browser* browser); 330 Browser* browser);
323 331
324 } // namespace chrome 332 } // namespace chrome
325 333
326 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ 334 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698