| 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 <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 12 #include "chrome/browser/extensions/webstore_standalone_installer.h" | 13 #include "chrome/browser/extensions/webstore_standalone_installer.h" |
| 13 #include "content/public/browser/web_contents_observer.h" | 14 #include "content/public/browser/web_contents_observer.h" |
| 14 | 15 |
| 15 namespace content { | 16 namespace content { |
| 16 class WebContents; | 17 class WebContents; |
| 17 } | 18 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 42 static bool IsRequestorPermitted(const base::DictionaryValue& webstore_data, | 43 static bool IsRequestorPermitted(const base::DictionaryValue& webstore_data, |
| 43 const GURL& requestor_url, | 44 const GURL& requestor_url, |
| 44 std::string* error); | 45 std::string* error); |
| 45 | 46 |
| 46 protected: | 47 protected: |
| 47 friend class base::RefCountedThreadSafe<WebstoreInlineInstaller>; | 48 friend class base::RefCountedThreadSafe<WebstoreInlineInstaller>; |
| 48 | 49 |
| 49 ~WebstoreInlineInstaller() override; | 50 ~WebstoreInlineInstaller() override; |
| 50 | 51 |
| 51 // Implementations WebstoreStandaloneInstaller Template Method's hooks. | 52 // Implementations WebstoreStandaloneInstaller Template Method's hooks. |
| 53 void OnBeforeWebstoreDataRequest(WebstoreDataFetcher* fetcher) override; |
| 52 bool CheckRequestorAlive() const override; | 54 bool CheckRequestorAlive() const override; |
| 53 const GURL& GetRequestorURL() const override; | 55 const GURL& GetRequestorURL() const override; |
| 54 bool ShouldShowPostInstallUI() const override; | 56 bool ShouldShowPostInstallUI() const override; |
| 55 bool ShouldShowAppInstalledBubble() const override; | 57 bool ShouldShowAppInstalledBubble() const override; |
| 56 content::WebContents* GetWebContents() const override; | 58 content::WebContents* GetWebContents() const override; |
| 57 std::unique_ptr<ExtensionInstallPrompt::Prompt> CreateInstallPrompt() | 59 std::unique_ptr<ExtensionInstallPrompt::Prompt> CreateInstallPrompt() |
| 58 const override; | 60 const override; |
| 59 bool CheckInlineInstallPermitted(const base::DictionaryValue& webstore_data, | 61 bool CheckInlineInstallPermitted(const base::DictionaryValue& webstore_data, |
| 60 std::string* error) const override; | 62 std::string* error) const override; |
| 61 bool CheckRequestorPermitted(const base::DictionaryValue& webstore_data, | 63 bool CheckRequestorPermitted(const base::DictionaryValue& webstore_data, |
| 62 std::string* error) const override; | 64 std::string* error) const override; |
| 63 | 65 |
| 64 private: | 66 private: |
| 65 // content::WebContentsObserver interface implementation. | 67 // content::WebContentsObserver interface implementation. |
| 66 void DidNavigateAnyFrame(content::RenderFrameHost* render_frame_host, | 68 void DidNavigateAnyFrame(content::RenderFrameHost* render_frame_host, |
| 67 const content::LoadCommittedDetails& details, | 69 const content::LoadCommittedDetails& details, |
| 68 const content::FrameNavigateParams& params) override; | 70 const content::FrameNavigateParams& params) override; |
| 69 void WebContentsDestroyed() override; | 71 void WebContentsDestroyed() override; |
| 70 | 72 |
| 71 // Checks whether the install is initiated by a page in a verified site | 73 // Checks whether the install is initiated by a page in a verified site |
| 72 // (which is at least a domain, but can also have a port or a path). | 74 // (which is at least a domain, but can also have a port or a path). |
| 73 static bool IsRequestorURLInVerifiedSite(const GURL& requestor_url, | 75 static bool IsRequestorURLInVerifiedSite(const GURL& requestor_url, |
| 74 const std::string& verified_site); | 76 const std::string& verified_site); |
| 75 | 77 |
| 78 void StartWebstoreDataRequest(WebstoreDataFetcher* fetcher, |
| 79 const std::vector<GURL> redirect_list); |
| 80 |
| 76 // This corresponds to the frame that initiated the install request. | 81 // This corresponds to the frame that initiated the install request. |
| 77 content::RenderFrameHost* host_; | 82 content::RenderFrameHost* host_; |
| 78 GURL requestor_url_; | 83 GURL requestor_url_; |
| 79 | 84 |
| 80 DISALLOW_IMPLICIT_CONSTRUCTORS(WebstoreInlineInstaller); | 85 DISALLOW_IMPLICIT_CONSTRUCTORS(WebstoreInlineInstaller); |
| 81 }; | 86 }; |
| 82 | 87 |
| 83 } // namespace extensions | 88 } // namespace extensions |
| 84 | 89 |
| 85 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INLINE_INSTALLER_H_ | 90 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INLINE_INSTALLER_H_ |
| OLD | NEW |