summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorskerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-03 14:30:06 +0000
committerskerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-03 14:30:06 +0000
commite8014aa57edec7e8e237af510200259a762088a8 (patch)
treee22b752991d2f7e5b8a5cb140fbeba8e1f122f6c
parentaaadcd81066a3430b33702288cd56a39986b4326 (diff)
downloadchromium_src-e8014aa57edec7e8e237af510200259a762088a8.zip
chromium_src-e8014aa57edec7e8e237af510200259a762088a8.tar.gz
chromium_src-e8014aa57edec7e8e237af510200259a762088a8.tar.bz2
Allow extension popups to shrink in single process mode.
BUG=None TEST=Manual testing of the news extensions. Review URL: http://codereview.chromium.org/660278 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40517 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/common/view_types.cc6
-rw-r--r--chrome/common/view_types.h3
-rw-r--r--chrome/renderer/render_view.cc5
3 files changed, 11 insertions, 3 deletions
diff --git a/chrome/common/view_types.cc b/chrome/common/view_types.cc
index fe14fd2..8d212ca 100644
--- a/chrome/common/view_types.cc
+++ b/chrome/common/view_types.cc
@@ -10,3 +10,9 @@ const char* ViewType::kMole = "MOLE";
const char* ViewType::kBackgroundPage = "BACKGROUND";
const char* ViewType::kPopup = "POPUP";
const char* ViewType::kAll = "ALL";
+
+bool ViewType::ShouldAutoResize(ViewType::Type view_type) {
+ return (view_type == EXTENSION_TOOLSTRIP ||
+ view_type == EXTENSION_MOLE ||
+ view_type == EXTENSION_POPUP);
+}
diff --git a/chrome/common/view_types.h b/chrome/common/view_types.h
index 794f9ab..fd94a69 100644
--- a/chrome/common/view_types.h
+++ b/chrome/common/view_types.h
@@ -30,6 +30,9 @@ class ViewType {
static const char* kPopup;
static const char* kAll;
+ // Return true if a view type should automatically resize to fit its contents.
+ static bool ShouldAutoResize(Type);
+
private:
// This class is for scoping only, so you shouldn't create an instance of it.
ViewType() {}
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 892735f..9197041 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -3624,11 +3624,10 @@ void RenderView::OnEnableViewSourceMode() {
void RenderView::OnEnablePreferredSizeChangedMode() {
send_preferred_size_changes_ = true;
- if (CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- switches::kProcessType) == switches::kExtensionProcess) {
+
+ if (ViewType::ShouldAutoResize(view_type_))
preferred_size_change_timer_.Start(TimeDelta::FromMilliseconds(10), this,
&RenderView::CheckPreferredSize);
- }
}
void RenderView::OnDisableScrollbarsForSmallWindows(