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

Unified Diff: chrome/browser/banners/app_banner_manager.cc

Issue 1569893003: Add "Request app banner" context menu in DevTools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated pfeldman's comment Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/banners/app_banner_manager.h ('k') | chrome/browser/banners/app_banner_manager_desktop.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/banners/app_banner_manager.cc
diff --git a/chrome/browser/banners/app_banner_manager.cc b/chrome/browser/banners/app_banner_manager.cc
index e984f2de63ec6015b6c1e87f305da057e163a619..6fe5b9ce04e5af407801212c84b0026a036adb4c 100644
--- a/chrome/browser/banners/app_banner_manager.cc
+++ b/chrome/browser/banners/app_banner_manager.cc
@@ -70,14 +70,19 @@ void AppBannerManager::DidNavigateMainFrame(
last_transition_type_ = params.transition;
}
-void AppBannerManager::DidFinishLoad(
+void AppBannerManager::RequestAppBanner(
content::RenderFrameHost* render_frame_host,
- const GURL& validated_url) {
- if (render_frame_host->GetParent())
+ const GURL& validated_url,
+ bool is_debug_mode) {
+ if (render_frame_host->GetParent()) {
+ OutputDeveloperNotShownMessage(web_contents(), kNotLoadedInMainFrame,
+ is_debug_mode);
return;
+ }
if (data_fetcher_.get() && data_fetcher_->is_active() &&
- URLsAreForTheSamePage(data_fetcher_->validated_url(), validated_url)) {
+ URLsAreForTheSamePage(data_fetcher_->validated_url(), validated_url) &&
+ !is_debug_mode) {
return;
}
@@ -85,18 +90,29 @@ void AppBannerManager::DidFinishLoad(
// URL is invalid.
if (!content::IsOriginSecure(validated_url) &&
!gDisableSecureCheckForTesting) {
- OutputDeveloperNotShownMessage(web_contents(), kNotServedFromSecureOrigin);
+ OutputDeveloperNotShownMessage(web_contents(), kNotServedFromSecureOrigin,
+ is_debug_mode);
return;
}
// Kick off the data retrieval pipeline.
- data_fetcher_ = CreateAppBannerDataFetcher(weak_factory_.GetWeakPtr());
+ data_fetcher_ =
+ CreateAppBannerDataFetcher(weak_factory_.GetWeakPtr(), is_debug_mode);
data_fetcher_->Start(validated_url, last_transition_type_);
}
+void AppBannerManager::DidFinishLoad(
+ content::RenderFrameHost* render_frame_host,
+ const GURL& validated_url) {
+ // The third argument is the is_debug_mode boolean value, which is true only
+ // when it is triggered by the developer's action in DevTools.
+ RequestAppBanner(render_frame_host, validated_url, false /* is_debug_mode */);
+}
+
bool AppBannerManager::HandleNonWebApp(const std::string& platform,
const GURL& url,
- const std::string& id) {
+ const std::string& id,
+ bool is_debug_mode) {
return false;
}
« no previous file with comments | « chrome/browser/banners/app_banner_manager.h ('k') | chrome/browser/banners/app_banner_manager_desktop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698