| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "chrome/browser/banners/app_banner_manager.h" | 5 #include "chrome/browser/banners/app_banner_manager.h" |
| 6 | 6 |
| 7 #include "chrome/browser/banners/app_banner_data_fetcher.h" | 7 #include "chrome/browser/banners/app_banner_data_fetcher.h" |
| 8 #include "chrome/browser/banners/app_banner_debug_log.h" | 8 #include "chrome/browser/banners/app_banner_debug_log.h" |
| 9 #include "chrome/browser/banners/app_banner_settings_helper.h" | 9 #include "chrome/browser/banners/app_banner_settings_helper.h" |
| 10 #include "content/public/browser/navigation_details.h" | 10 #include "content/public/browser/navigation_details.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 CancelActiveFetcher(); | 53 CancelActiveFetcher(); |
| 54 } | 54 } |
| 55 | 55 |
| 56 void AppBannerManager::ReplaceWebContents(content::WebContents* web_contents) { | 56 void AppBannerManager::ReplaceWebContents(content::WebContents* web_contents) { |
| 57 Observe(web_contents); | 57 Observe(web_contents); |
| 58 if (data_fetcher_.get()) | 58 if (data_fetcher_.get()) |
| 59 data_fetcher_.get()->ReplaceWebContents(web_contents); | 59 data_fetcher_.get()->ReplaceWebContents(web_contents); |
| 60 } | 60 } |
| 61 | 61 |
| 62 bool AppBannerManager::IsFetcherActive() { | 62 bool AppBannerManager::IsFetcherActive() { |
| 63 return data_fetcher_ != nullptr && data_fetcher_->is_active(); | 63 return data_fetcher_ && data_fetcher_->is_active(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void AppBannerManager::DidNavigateMainFrame( | 66 void AppBannerManager::DidNavigateMainFrame( |
| 67 const content::LoadCommittedDetails& details, | 67 const content::LoadCommittedDetails& details, |
| 68 const content::FrameNavigateParams& params) { | 68 const content::FrameNavigateParams& params) { |
| 69 last_transition_type_ = params.transition; | 69 last_transition_type_ = params.transition; |
| 70 } | 70 } |
| 71 | 71 |
| 72 void AppBannerManager::RequestAppBanner( | 72 void AppBannerManager::RequestAppBanner( |
| 73 content::RenderFrameHost* render_frame_host, | 73 content::RenderFrameHost* render_frame_host, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 } | 109 } |
| 110 | 110 |
| 111 bool AppBannerManager::HandleNonWebApp(const std::string& platform, | 111 bool AppBannerManager::HandleNonWebApp(const std::string& platform, |
| 112 const GURL& url, | 112 const GURL& url, |
| 113 const std::string& id, | 113 const std::string& id, |
| 114 bool is_debug_mode) { | 114 bool is_debug_mode) { |
| 115 return false; | 115 return false; |
| 116 } | 116 } |
| 117 | 117 |
| 118 void AppBannerManager::CancelActiveFetcher() { | 118 void AppBannerManager::CancelActiveFetcher() { |
| 119 if (data_fetcher_ != nullptr) { | 119 if (data_fetcher_) { |
| 120 data_fetcher_->Cancel(); | 120 data_fetcher_->Cancel(); |
| 121 data_fetcher_ = nullptr; | 121 data_fetcher_ = nullptr; |
| 122 } | 122 } |
| 123 } | 123 } |
| 124 | 124 |
| 125 } // namespace banners | 125 } // namespace banners |
| OLD | NEW |