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

Unified Diff: chrome/browser/ui/browser.cc

Issue 1955183002: Revert of DevTools: account for the display scale factor while validating manifest under emulation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 40354c26444ca7b998fac5c2e1bb71c497fcbe9f..017d081cabb6c8b4f4312aa95d1b5ab9e5aa19d2 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -36,7 +36,6 @@
#include "chrome/browser/background/background_contents_service.h"
#include "chrome/browser/background/background_contents_service_factory.h"
#include "chrome/browser/banners/app_banner_manager_desktop.h"
-#include "chrome/browser/banners/app_banner_manager_emulation.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_shutdown.h"
#include "chrome/browser/character_encoding.h"
@@ -1448,11 +1447,24 @@
}
void Browser::RequestAppBannerFromDevTools(content::WebContents* web_contents) {
- banners::AppBannerManagerEmulation::CreateForWebContents(web_contents);
- banners::AppBannerManagerEmulation* manager =
- banners::AppBannerManagerEmulation::FromWebContents(web_contents);
- manager->RequestAppBanner(web_contents->GetMainFrame(),
- web_contents->GetLastCommittedURL(), true);
+ banners::AppBannerManagerDesktop::CreateForWebContents(web_contents);
+ RequestAppBanner(web_contents);
+}
+
+bool Browser::RequestAppBanner(content::WebContents* web_contents) {
+ banners::AppBannerManagerDesktop* manager =
+ banners::AppBannerManagerDesktop::FromWebContents(web_contents);
+ if (manager) {
+ manager->RequestAppBanner(web_contents->GetMainFrame(),
+ web_contents->GetLastCommittedURL(), true);
+ return true;
+ }
+
+ web_contents->GetMainFrame()->AddMessageToConsole(
+ content::CONSOLE_MESSAGE_LEVEL_DEBUG,
+ "App banners are currently disabled. Please check chrome://flags/#" +
+ std::string(switches::kEnableAddToShelf));
+ return false;
}
bool Browser::IsMouseLocked() const {
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698