Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALL_PROMPT_H_ | |
| 6 #define CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALL_PROMPT_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "content/public/browser/page_navigator.h" | |
| 10 #include "url/gurl.h" | |
| 11 #include "webstore_standalone_installer.h" | |
|
tapted
2014/05/28 06:28:46
this should have the full path
| |
| 12 | |
| 13 namespace content { | |
| 14 class WebContents; | |
| 15 } | |
| 16 | |
| 17 namespace extensions { | |
|
tapted
2014/05/28 06:28:46
Things under chrome/browser don't typically go in
| |
| 18 | |
| 19 // Initiates the install of an extension from the webstore. Downloads and parses | |
| 20 // metadata from the webstore, shows an install UI and starts the download once | |
| 21 // the user confirms. No post-install UI is shown. | |
| 22 // | |
| 23 // Clients will be notified of success or failure via the |callback| argument | |
| 24 // passed into the constructor. | |
| 25 // | |
| 26 // Clients of this class must be trusted, as verification of the requestor is | |
| 27 // skipped. This class stubs out many WebstoreStandaloneInstaller abstract | |
| 28 // methods and can be used as a base class. | |
| 29 class WebstoreInstallPrompt : public WebstoreStandaloneInstaller, | |
| 30 public content::PageNavigator { | |
| 31 public: | |
| 32 typedef WebstoreStandaloneInstaller::Callback Callback; | |
|
tapted
2014/05/28 06:28:46
I.. think this line is redundant -- inheriting fro
| |
| 33 | |
| 34 // Use this constructor when there is no parent window. The install dialog | |
| 35 // will be centered on the screen. | |
| 36 WebstoreInstallPrompt(const std::string& webstore_item_id, | |
| 37 Profile* profile, | |
| 38 const Callback& callback); | |
| 39 | |
| 40 // If this constructor is used, the parent of the install dialog will be | |
| 41 // |parent_window|. | |
| 42 WebstoreInstallPrompt(const std::string& webstore_item_id, | |
| 43 Profile* profile, | |
|
tapted
2014/05/28 06:28:46
nit: indenting is off
| |
| 44 gfx::NativeWindow parent_window, | |
| 45 const Callback& callback); | |
| 46 | |
| 47 protected: | |
| 48 friend class base::RefCountedThreadSafe<WebstoreInstallPrompt>; | |
| 49 virtual ~WebstoreInstallPrompt(); | |
| 50 | |
| 51 // extensions::WebstoreStartupInstaller overrides: | |
|
tapted
2014/05/28 06:28:46
Startup -> Standalone?
| |
| 52 virtual bool CheckRequestorAlive() const OVERRIDE; | |
| 53 virtual const GURL& GetRequestorURL() const OVERRIDE; | |
| 54 virtual bool ShouldShowPostInstallUI() const OVERRIDE; | |
| 55 virtual bool ShouldShowAppInstalledBubble() const OVERRIDE; | |
| 56 virtual content::WebContents* GetWebContents() const OVERRIDE; | |
| 57 virtual scoped_ptr<ExtensionInstallPrompt::Prompt> CreateInstallPrompt() | |
| 58 const OVERRIDE; | |
|
tapted
2014/05/28 06:28:46
nit: const/OVERRIDE shouldn't appear on a line by
tmdiep
2014/05/28 08:39:27
git cl format put the "const OVERRIDE" in a new li
tapted
2014/05/28 12:57:32
probably an accident/clang-format bug - clang-form
| |
| 59 virtual scoped_ptr<ExtensionInstallPrompt> CreateInstallUI() OVERRIDE; | |
| 60 virtual bool CheckInlineInstallPermitted( | |
| 61 const base::DictionaryValue& webstore_data, | |
| 62 std::string* error) const OVERRIDE; | |
| 63 virtual bool CheckRequestorPermitted( | |
| 64 const base::DictionaryValue& webstore_data, | |
| 65 std::string* error) const OVERRIDE; | |
| 66 | |
| 67 // content::PageNavigator overrides: | |
| 68 virtual content::WebContents* OpenURL( | |
| 69 const content::OpenURLParams& params) OVERRIDE; | |
| 70 | |
| 71 private: | |
| 72 GURL dummy_requestor_url_; | |
| 73 | |
| 74 // A non-visible WebContents used to download data from the webstore. | |
| 75 scoped_ptr<content::WebContents> dummy_web_contents_; | |
|
tapted
2014/05/28 06:28:46
nit: #include scoped_ptr for this
| |
| 76 | |
| 77 gfx::NativeWindow parent_window_; | |
|
tapted
2014/05/28 06:28:46
nit: #include native_widget_types.h
| |
| 78 | |
| 79 DISALLOW_IMPLICIT_CONSTRUCTORS(WebstoreInstallPrompt); | |
|
tapted
2014/05/28 06:28:46
nit: I think this is only if you don't define *any
| |
| 80 }; | |
| 81 | |
| 82 } // namespace extensions | |
| 83 | |
| 84 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALL_PROMPT_H_ | |
| OLD | NEW |