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

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

Issue 298303002: Add option to install an ephemeral app to ChromeOS shelf context menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed asargent's review comments Created 6 years, 6 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
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_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 "chrome/browser/extensions/webstore_install_with_prompt.h"
9 #include "webstore_standalone_installer.h"
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 WebstoreInstallWithPrompt {
25 : public WebstoreStandaloneInstaller {
26 public: 20 public:
27 typedef WebstoreStandaloneInstaller::Callback Callback;
28
29 WebstoreStartupInstaller(const std::string& webstore_item_id, 21 WebstoreStartupInstaller(const std::string& webstore_item_id,
30 Profile* profile, 22 Profile* profile,
31 bool show_prompt, 23 bool show_prompt,
32 const Callback& callback); 24 const Callback& callback);
33 25
34 protected: 26 protected:
35 friend class base::RefCountedThreadSafe<WebstoreStartupInstaller>; 27 friend class base::RefCountedThreadSafe<WebstoreStartupInstaller>;
36 FRIEND_TEST_ALL_PREFIXES(WebstoreStartupInstallerTest, DomainVerification); 28 FRIEND_TEST_ALL_PREFIXES(WebstoreStartupInstallerTest, DomainVerification);
37 29
38 virtual ~WebstoreStartupInstaller(); 30 virtual ~WebstoreStartupInstaller();
39 31
40 // Implementations WebstoreStandaloneInstaller Template Method's hooks. 32 // 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> 33 virtual scoped_ptr<ExtensionInstallPrompt::Prompt>
47 CreateInstallPrompt() const OVERRIDE; 34 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 35
56 private: 36 private:
57 bool show_prompt_; 37 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 38
63 DISALLOW_IMPLICIT_CONSTRUCTORS(WebstoreStartupInstaller); 39 DISALLOW_IMPLICIT_CONSTRUCTORS(WebstoreStartupInstaller);
64 }; 40 };
65 41
66 } // namespace extensions 42 } // namespace extensions
67 43
68 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_STARTUP_INSTALLER_H_ 44 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_STARTUP_INSTALLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/webstore_install_with_prompt.cc ('k') | chrome/browser/extensions/webstore_startup_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698