summaryrefslogtreecommitdiffstats
path: root/extensions/browser/app_window
diff options
context:
space:
mode:
authorbenwells <benwells@chromium.org>2015-01-12 15:16:01 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-12 23:16:58 +0000
commit9d9b1161ed6454aac72a97496babc7de5469cc56 (patch)
treedd8bdabaa90a8dbd4e24d1d529d63e9af4c4bd5c /extensions/browser/app_window
parentee3fa9866a01dc2fcd1e3beb188c683ba4d79e8b (diff)
downloadchromium_src-9d9b1161ed6454aac72a97496babc7de5469cc56.zip
chromium_src-9d9b1161ed6454aac72a97496babc7de5469cc56.tar.gz
chromium_src-9d9b1161ed6454aac72a97496babc7de5469cc56.tar.bz2
Keep app default zoom level independent of the browser zoom level.
This was mostly done already with the defalut zoom level being stored as a StoragePartition level preference. However when the renderer preferences were set they did not use the default zoom of the correct StoragePartition; the default StoragePartition's default zoom was always used. Due to this bug apps could easily have host specific zoom levels set mistakenly. This change also removes any host specific zoom levels of apps as they are started. If apps ever get the capability to zoom this will need to be removed. BUG=407333, 153568, 411073, 446759 Review URL: https://codereview.chromium.org/839023002 Cr-Commit-Position: refs/heads/master@{#311138}
Diffstat (limited to 'extensions/browser/app_window')
-rw-r--r--extensions/browser/app_window/app_delegate.h2
-rw-r--r--extensions/browser/app_window/app_window.cc10
-rw-r--r--extensions/browser/app_window/app_window.h1
3 files changed, 9 insertions, 4 deletions
diff --git a/extensions/browser/app_window/app_delegate.h b/extensions/browser/app_window/app_delegate.h
index 0e4477e..70f9f12 100644
--- a/extensions/browser/app_window/app_delegate.h
+++ b/extensions/browser/app_window/app_delegate.h
@@ -15,6 +15,7 @@ class BrowserContext;
class ColorChooser;
struct FileChooserParams;
struct OpenURLParams;
+class RenderViewHost;
class WebContents;
}
@@ -35,6 +36,7 @@ class AppDelegate {
// General initialization.
virtual void InitWebContents(content::WebContents* web_contents) = 0;
+ virtual void RenderViewCreated(content::RenderViewHost* render_view_host) = 0;
// Resizes WebContents.
virtual void ResizeWebContents(content::WebContents* web_contents,
diff --git a/extensions/browser/app_window/app_window.cc b/extensions/browser/app_window/app_window.cc
index 9ed0342..db64d5f 100644
--- a/extensions/browser/app_window/app_window.cc
+++ b/extensions/browser/app_window/app_window.cc
@@ -254,10 +254,8 @@ void AppWindow::Init(const GURL& url,
// Initialize the render interface and web contents
app_window_contents_.reset(app_window_contents);
app_window_contents_->Initialize(browser_context(), url);
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableAppsShowOnFirstPaint)) {
- content::WebContentsObserver::Observe(web_contents());
- }
+
+ content::WebContentsObserver::Observe(web_contents());
app_delegate_->InitWebContents(web_contents());
WebContentsModalDialogManager::CreateForWebContents(web_contents());
@@ -439,6 +437,10 @@ bool AppWindow::PreHandleGestureEvent(WebContents* source,
return AppWebContentsHelper::ShouldSuppressGestureEvent(event);
}
+void AppWindow::RenderViewCreated(content::RenderViewHost* render_view_host) {
+ app_delegate_->RenderViewCreated(render_view_host);
+}
+
void AppWindow::DidFirstVisuallyNonEmptyPaint() {
first_paint_complete_ = true;
if (show_on_first_paint_) {
diff --git a/extensions/browser/app_window/app_window.h b/extensions/browser/app_window/app_window.h
index 71db220..e218f81 100644
--- a/extensions/browser/app_window/app_window.h
+++ b/extensions/browser/app_window/app_window.h
@@ -409,6 +409,7 @@ class AppWindow : public content::NotificationObserver,
const blink::WebGestureEvent& event) override;
// content::WebContentsObserver implementation.
+ void RenderViewCreated(content::RenderViewHost* render_view_host) override;
void DidFirstVisuallyNonEmptyPaint() override;
// content::NotificationObserver implementation.