| 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 "base/metrics/field_trial.h" | 7 #include "base/metrics/field_trial.h" |
| 8 #include "chrome/browser/banners/app_banner_data_fetcher.h" | 8 #include "chrome/browser/banners/app_banner_data_fetcher.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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 if (!validated_url.SchemeIsSecure() && !gDisableSecureCheckForTesting) | 52 if (!validated_url.SchemeIsSecure() && !gDisableSecureCheckForTesting) |
| 53 return; | 53 return; |
| 54 | 54 |
| 55 // Kick off the data retrieval pipeline. | 55 // Kick off the data retrieval pipeline. |
| 56 data_fetcher_ = CreateAppBannerDataFetcher(weak_factory_.GetWeakPtr(), | 56 data_fetcher_ = CreateAppBannerDataFetcher(weak_factory_.GetWeakPtr(), |
| 57 ideal_icon_size_); | 57 ideal_icon_size_); |
| 58 data_fetcher_->Start(validated_url); | 58 data_fetcher_->Start(validated_url); |
| 59 } | 59 } |
| 60 | 60 |
| 61 | 61 |
| 62 bool AppBannerManager::OnInvalidManifest(AppBannerDataFetcher* fetcher) { | 62 bool AppBannerManager::HandleNonWebApp(const std::string& platform, |
| 63 const GURL& url, |
| 64 const std::string& id) { |
| 63 return false; | 65 return false; |
| 64 } | 66 } |
| 65 | 67 |
| 66 void AppBannerManager::ReplaceWebContents(content::WebContents* web_contents) { | 68 void AppBannerManager::ReplaceWebContents(content::WebContents* web_contents) { |
| 67 Observe(web_contents); | 69 Observe(web_contents); |
| 68 if (data_fetcher_.get()) | 70 if (data_fetcher_.get()) |
| 69 data_fetcher_.get()->ReplaceWebContents(web_contents); | 71 data_fetcher_.get()->ReplaceWebContents(web_contents); |
| 70 } | 72 } |
| 71 | 73 |
| 72 AppBannerDataFetcher* AppBannerManager::CreateAppBannerDataFetcher( | 74 AppBannerDataFetcher* AppBannerManager::CreateAppBannerDataFetcher( |
| (...skipping 16 matching lines...) Expand all Loading... |
| 89 | 91 |
| 90 void AppBannerManager::DisableSecureSchemeCheckForTesting() { | 92 void AppBannerManager::DisableSecureSchemeCheckForTesting() { |
| 91 gDisableSecureCheckForTesting = true; | 93 gDisableSecureCheckForTesting = true; |
| 92 } | 94 } |
| 93 | 95 |
| 94 bool AppBannerManager::IsEnabled() { | 96 bool AppBannerManager::IsEnabled() { |
| 95 return base::FieldTrialList::FindFullName("AppBanners") == "Enabled"; | 97 return base::FieldTrialList::FindFullName("AppBanners") == "Enabled"; |
| 96 } | 98 } |
| 97 | 99 |
| 98 } // namespace banners | 100 } // namespace banners |
| OLD | NEW |