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

Side by Side Diff: chrome/browser/banners/app_banner_manager.cc

Issue 1129103003: Log messages regarding why app banners aren't displayed to the console (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Factoring out debug log message function Created 5 years, 7 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 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_debug_log.h"
9 #include "chrome/browser/banners/app_banner_settings_helper.h" 10 #include "chrome/browser/banners/app_banner_settings_helper.h"
10 #include "content/public/browser/navigation_details.h" 11 #include "content/public/browser/navigation_details.h"
11 #include "content/public/browser/render_frame_host.h" 12 #include "content/public/browser/render_frame_host.h"
12 #include "content/public/browser/web_contents.h" 13 #include "content/public/browser/web_contents.h"
13 #include "content/public/common/frame_navigate_params.h" 14 #include "content/public/common/frame_navigate_params.h"
14 #include "net/base/load_flags.h" 15 #include "net/base/load_flags.h"
15 #include "ui/gfx/screen.h" 16 #include "ui/gfx/screen.h"
16 17
17 namespace { 18 namespace {
18 bool gDisableSecureCheckForTesting = false; 19 bool gDisableSecureCheckForTesting = false;
(...skipping 23 matching lines...) Expand all
42 if (render_frame_host->GetParent()) 43 if (render_frame_host->GetParent())
43 return; 44 return;
44 45
45 if (data_fetcher_.get() && data_fetcher_->is_active() && 46 if (data_fetcher_.get() && data_fetcher_->is_active() &&
46 URLsAreForTheSamePage(data_fetcher_->validated_url(), validated_url)) { 47 URLsAreForTheSamePage(data_fetcher_->validated_url(), validated_url)) {
47 return; 48 return;
48 } 49 }
49 50
50 // A secure scheme is required to show banners, so exit early if we see the 51 // A secure scheme is required to show banners, so exit early if we see the
51 // URL is invalid. 52 // URL is invalid.
52 if (!validated_url.SchemeIsSecure() && !gDisableSecureCheckForTesting) 53 if (!validated_url.SchemeIsSecure() && !gDisableSecureCheckForTesting) {
54 SendDebugMessage(web_contents(),
55 "not shown: page not served over secure scheme");
benwells 2015/05/11 08:08:40 FYI this is about to go out of date. To match the
dominickn (DO NOT USE) 2015/05/12 07:41:31 Done.
53 return; 56 return;
57 }
54 58
55 // Kick off the data retrieval pipeline. 59 // Kick off the data retrieval pipeline.
56 data_fetcher_ = CreateAppBannerDataFetcher(weak_factory_.GetWeakPtr(), 60 data_fetcher_ = CreateAppBannerDataFetcher(weak_factory_.GetWeakPtr(),
57 ideal_icon_size_); 61 ideal_icon_size_);
58 data_fetcher_->Start(validated_url); 62 data_fetcher_->Start(validated_url);
59 } 63 }
60 64
61 65
62 bool AppBannerManager::HandleNonWebApp(const std::string& platform, 66 bool AppBannerManager::HandleNonWebApp(const std::string& platform,
63 const GURL& url, 67 const GURL& url,
(...skipping 27 matching lines...) Expand all
91 95
92 void AppBannerManager::DisableSecureSchemeCheckForTesting() { 96 void AppBannerManager::DisableSecureSchemeCheckForTesting() {
93 gDisableSecureCheckForTesting = true; 97 gDisableSecureCheckForTesting = true;
94 } 98 }
95 99
96 bool AppBannerManager::IsEnabled() { 100 bool AppBannerManager::IsEnabled() {
97 return base::FieldTrialList::FindFullName("AppBanners") == "Enabled"; 101 return base::FieldTrialList::FindFullName("AppBanners") == "Enabled";
98 } 102 }
99 103
100 } // namespace banners 104 } // namespace banners
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698