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_INLINE_INSTALLER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_WEBSTORE_INLINE_INSTALLER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_WEBSTORE_INLINE_INSTALLER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_WEBSTORE_INLINE_INSTALLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 typedef WebstoreStandaloneInstaller::Callback Callback; | 32 typedef WebstoreStandaloneInstaller::Callback Callback; |
33 | 33 |
34 WebstoreInlineInstaller(content::WebContents* web_contents, | 34 WebstoreInlineInstaller(content::WebContents* web_contents, |
35 const std::string& webstore_item_id, | 35 const std::string& webstore_item_id, |
36 const GURL& requestor_url, | 36 const GURL& requestor_url, |
37 const Callback& callback); | 37 const Callback& callback); |
38 | 38 |
39 protected: | 39 protected: |
40 friend class base::RefCountedThreadSafe<WebstoreInlineInstaller>; | 40 friend class base::RefCountedThreadSafe<WebstoreInlineInstaller>; |
41 | 41 |
42 virtual ~WebstoreInlineInstaller(); | 42 ~WebstoreInlineInstaller() override; |
43 | 43 |
44 // Implementations WebstoreStandaloneInstaller Template Method's hooks. | 44 // Implementations WebstoreStandaloneInstaller Template Method's hooks. |
45 virtual bool CheckRequestorAlive() const override; | 45 bool CheckRequestorAlive() const override; |
46 virtual const GURL& GetRequestorURL() const override; | 46 const GURL& GetRequestorURL() const override; |
47 virtual bool ShouldShowPostInstallUI() const override; | 47 bool ShouldShowPostInstallUI() const override; |
48 virtual bool ShouldShowAppInstalledBubble() const override; | 48 bool ShouldShowAppInstalledBubble() const override; |
49 virtual content::WebContents* GetWebContents() const override; | 49 content::WebContents* GetWebContents() const override; |
50 virtual scoped_refptr<ExtensionInstallPrompt::Prompt> CreateInstallPrompt() | 50 scoped_refptr<ExtensionInstallPrompt::Prompt> CreateInstallPrompt() |
51 const override; | 51 const override; |
52 virtual bool CheckInlineInstallPermitted( | 52 bool CheckInlineInstallPermitted(const base::DictionaryValue& webstore_data, |
53 const base::DictionaryValue& webstore_data, | 53 std::string* error) const override; |
54 std::string* error) const override; | 54 bool CheckRequestorPermitted(const base::DictionaryValue& webstore_data, |
55 virtual bool CheckRequestorPermitted( | 55 std::string* error) const override; |
56 const base::DictionaryValue& webstore_data, | |
57 std::string* error) const override; | |
58 | 56 |
59 private: | 57 private: |
60 // content::WebContentsObserver interface implementation. | 58 // content::WebContentsObserver interface implementation. |
61 virtual void WebContentsDestroyed() override; | 59 void WebContentsDestroyed() override; |
62 | 60 |
63 // Checks whether the install is initiated by a page in a verified site | 61 // Checks whether the install is initiated by a page in a verified site |
64 // (which is at least a domain, but can also have a port or a path). | 62 // (which is at least a domain, but can also have a port or a path). |
65 static bool IsRequestorURLInVerifiedSite(const GURL& requestor_url, | 63 static bool IsRequestorURLInVerifiedSite(const GURL& requestor_url, |
66 const std::string& verified_site); | 64 const std::string& verified_site); |
67 | 65 |
68 GURL requestor_url_; | 66 GURL requestor_url_; |
69 | 67 |
70 DISALLOW_IMPLICIT_CONSTRUCTORS(WebstoreInlineInstaller); | 68 DISALLOW_IMPLICIT_CONSTRUCTORS(WebstoreInlineInstaller); |
71 }; | 69 }; |
72 | 70 |
73 } // namespace extensions | 71 } // namespace extensions |
74 | 72 |
75 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INLINE_INSTALLER_H_ | 73 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INLINE_INSTALLER_H_ |
OLD | NEW |