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

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: Adding a full stop to the end of a comment 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
« no previous file with comments | « chrome/browser/banners/app_banner_debug_log.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/public/common/origin_util.h" 15 #include "content/public/common/origin_util.h"
15 #include "net/base/load_flags.h" 16 #include "net/base/load_flags.h"
16 #include "ui/gfx/screen.h" 17 #include "ui/gfx/screen.h"
17 18
18 namespace { 19 namespace {
(...skipping 24 matching lines...) Expand all
43 if (render_frame_host->GetParent()) 44 if (render_frame_host->GetParent())
44 return; 45 return;
45 46
46 if (data_fetcher_.get() && data_fetcher_->is_active() && 47 if (data_fetcher_.get() && data_fetcher_->is_active() &&
47 URLsAreForTheSamePage(data_fetcher_->validated_url(), validated_url)) { 48 URLsAreForTheSamePage(data_fetcher_->validated_url(), validated_url)) {
48 return; 49 return;
49 } 50 }
50 51
51 // A secure origin is required to show banners, so exit early if we see the 52 // A secure origin is required to show banners, so exit early if we see the
52 // URL is invalid. 53 // URL is invalid.
53 if (!content::IsOriginSecure(validated_url) && !gDisableSecureCheckForTesting) 54 if (!content::IsOriginSecure(validated_url) &&
55 !gDisableSecureCheckForTesting) {
56 OutputDeveloperNotShownMessage(web_contents(), kNotServedFromSecureOrigin);
54 return; 57 return;
58 }
55 59
56 // Kick off the data retrieval pipeline. 60 // Kick off the data retrieval pipeline.
57 data_fetcher_ = CreateAppBannerDataFetcher(weak_factory_.GetWeakPtr(), 61 data_fetcher_ = CreateAppBannerDataFetcher(weak_factory_.GetWeakPtr(),
58 ideal_icon_size_); 62 ideal_icon_size_);
59 data_fetcher_->Start(validated_url); 63 data_fetcher_->Start(validated_url);
60 } 64 }
61 65
62 66
63 bool AppBannerManager::HandleNonWebApp(const std::string& platform, 67 bool AppBannerManager::HandleNonWebApp(const std::string& platform,
64 const GURL& url, 68 const GURL& url,
(...skipping 27 matching lines...) Expand all
92 96
93 void AppBannerManager::DisableSecureSchemeCheckForTesting() { 97 void AppBannerManager::DisableSecureSchemeCheckForTesting() {
94 gDisableSecureCheckForTesting = true; 98 gDisableSecureCheckForTesting = true;
95 } 99 }
96 100
97 bool AppBannerManager::IsEnabled() { 101 bool AppBannerManager::IsEnabled() {
98 return base::FieldTrialList::FindFullName("AppBanners") == "Enabled"; 102 return base::FieldTrialList::FindFullName("AppBanners") == "Enabled";
99 } 103 }
100 104
101 } // namespace banners 105 } // namespace banners
OLDNEW
« no previous file with comments | « chrome/browser/banners/app_banner_debug_log.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698