OLD | NEW |
---|---|
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_WEBSTORE_STARTUP_INSTALLER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_WEBSTORE_STARTUP_INSTALLER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_WEBSTORE_STARTUP_INSTALLER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_WEBSTORE_STARTUP_INSTALLER_H_ |
7 | 7 |
8 #include "url/gurl.h" | 8 #include "webstore_install_prompt.h" |
tapted
2014/05/28 06:28:46
this should be the full path.
| |
9 #include "webstore_standalone_installer.h" | |
tapted
2014/05/28 06:28:46
:o
| |
10 | |
11 namespace content { | |
12 class WebContents; | |
13 } | |
14 | 9 |
15 namespace extensions { | 10 namespace extensions { |
16 | 11 |
17 // Manages inline installs requested to be performed at startup, e.g. via a | 12 // Manages inline installs requested to be performed at startup, e.g. via a |
18 // command line option: downloads and parses metadata from the webstore, | 13 // command line option: downloads and parses metadata from the webstore, |
19 // optionally shows an install UI, starts the download once the user | 14 // optionally shows an install UI, starts the download once the user |
20 // confirms. | 15 // confirms. |
21 // | 16 // |
22 // Clients will be notified of success or failure via the |callback| argument | 17 // Clients will be notified of success or failure via the |callback| argument |
23 // passed into the constructor. | 18 // passed into the constructor. |
24 class WebstoreStartupInstaller | 19 class WebstoreStartupInstaller : public WebstoreInstallPrompt { |
25 : public WebstoreStandaloneInstaller { | |
26 public: | 20 public: |
27 typedef WebstoreStandaloneInstaller::Callback Callback; | 21 typedef WebstoreStandaloneInstaller::Callback Callback; |
28 | 22 |
29 WebstoreStartupInstaller(const std::string& webstore_item_id, | 23 WebstoreStartupInstaller(const std::string& webstore_item_id, |
30 Profile* profile, | 24 Profile* profile, |
31 bool show_prompt, | 25 bool show_prompt, |
32 const Callback& callback); | 26 const Callback& callback); |
33 | 27 |
34 protected: | 28 protected: |
35 friend class base::RefCountedThreadSafe<WebstoreStartupInstaller>; | 29 friend class base::RefCountedThreadSafe<WebstoreStartupInstaller>; |
36 FRIEND_TEST_ALL_PREFIXES(WebstoreStartupInstallerTest, DomainVerification); | 30 FRIEND_TEST_ALL_PREFIXES(WebstoreStartupInstallerTest, DomainVerification); |
37 | 31 |
38 virtual ~WebstoreStartupInstaller(); | 32 virtual ~WebstoreStartupInstaller(); |
39 | 33 |
40 // Implementations WebstoreStandaloneInstaller Template Method's hooks. | 34 // Implementations of WebstoreStandaloneInstaller Template Method's hooks. |
41 virtual bool CheckRequestorAlive() const OVERRIDE; | |
42 virtual const GURL& GetRequestorURL() const OVERRIDE; | |
43 virtual bool ShouldShowPostInstallUI() const OVERRIDE; | |
44 virtual bool ShouldShowAppInstalledBubble() const OVERRIDE; | |
45 virtual content::WebContents* GetWebContents() const OVERRIDE; | |
46 virtual scoped_ptr<ExtensionInstallPrompt::Prompt> | 35 virtual scoped_ptr<ExtensionInstallPrompt::Prompt> |
47 CreateInstallPrompt() const OVERRIDE; | 36 CreateInstallPrompt() const OVERRIDE; |
48 virtual scoped_ptr<ExtensionInstallPrompt> CreateInstallUI() OVERRIDE; | |
49 virtual bool CheckInlineInstallPermitted( | |
50 const base::DictionaryValue& webstore_data, | |
51 std::string* error) const OVERRIDE; | |
52 virtual bool CheckRequestorPermitted( | |
53 const base::DictionaryValue& webstore_data, | |
54 std::string* error) const OVERRIDE; | |
55 | 37 |
56 private: | 38 private: |
57 bool show_prompt_; | 39 bool show_prompt_; |
58 GURL dummy_requestor_url_; | |
59 | |
60 // A non-visible WebContents used to download data from the webstore. | |
61 scoped_ptr<content::WebContents> dummy_web_contents_; | |
62 | 40 |
63 DISALLOW_IMPLICIT_CONSTRUCTORS(WebstoreStartupInstaller); | 41 DISALLOW_IMPLICIT_CONSTRUCTORS(WebstoreStartupInstaller); |
64 }; | 42 }; |
65 | 43 |
66 } // namespace extensions | 44 } // namespace extensions |
67 | 45 |
68 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_STARTUP_INSTALLER_H_ | 46 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_STARTUP_INSTALLER_H_ |
OLD | NEW |