summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjennb@chromium.org <jennb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-13 23:30:11 +0000
committerjennb@chromium.org <jennb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-13 23:30:11 +0000
commit7cf208c2e138c5937695fe0b0e42b3acc80e44fd (patch)
tree2731c655ef667a611a916eb168e6b444eddaee57
parentbbd72bc25fbede171d86a5367549bd3373fe6e07 (diff)
downloadchromium_src-7cf208c2e138c5937695fe0b0e42b3acc80e44fd.zip
chromium_src-7cf208c2e138c5937695fe0b0e42b3acc80e44fd.tar.gz
chromium_src-7cf208c2e138c5937695fe0b0e42b3acc80e44fd.tar.bz2
Reverting until I figure out how to make drover pick up the change to the test file, too.
Revert 114293 - Merge 113866 - Panels back behind a flag except for dev/canary. Giving it more time to bake. BUG=107422 TEST=tests updated Review URL: http://codereview.chromium.org/8863011 TBR=jennb@chromium.org Review URL: http://codereview.chromium.org/8890085 TBR=jennb@chromium.org Review URL: http://codereview.chromium.org/8934012 git-svn-id: svn://svn.chromium.org/chrome/branches/963/src@114304 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/generated_resources.grd8
-rw-r--r--chrome/browser/about_flags.cc8
-rw-r--r--chrome/browser/extensions/extension_tabs_module.cc11
-rw-r--r--chrome/browser/ui/browser.cc7
-rw-r--r--chrome/browser/ui/panels/panel_manager.cc19
-rw-r--r--chrome/browser/ui/panels/panel_manager.h3
-rw-r--r--chrome/common/chrome_switches.cc6
-rw-r--r--chrome/common/chrome_switches.h2
8 files changed, 21 insertions, 43 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 89063c9..347fa5f 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -4891,11 +4891,11 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_FLAGS_ENABLE_ADDITIONAL_AUTOFILL_FEEDBACK_DESCRIPTION" desc="Description for the flag to enable prompts for Autofill feedback">
Help improve Autofill. With this enabled, Chrome will occasionally prompt you to send additional feedback to the Autofill team.
</message>
- <message name="IDS_FLAGS_ENABLE_PANELS_NAME" desc="Name of the 'Enable Panels' lab.">
- Enable Panels
+ <message name="IDS_FLAGS_DISABLE_PANELS_NAME" desc="Name of the 'Disable Panels' lab.">
+ Disable Panels
</message>
- <message name="IDS_FLAGS_ENABLE_PANELS_DESCRIPTION" desc="Description for the flag to enable Panel windows.">
- Enable Panel windows that open outside of the browser frame. Attempts to open a Panel will open a popup instead if not enabled.
+ <message name="IDS_FLAGS_DISABLE_PANELS_DESCRIPTION" desc="Description for the flag to disable Panel windows.">
+ Disable Panel windows that open outside of the browser frame. Attempts to open a Panel will open a popup instead.
</message>
<message name="IDS_FLAGS_DISABLE_WEBGL_NAME" desc="Name of the 'Disable WebGL' lab.">
WebGL
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 55017ec..52208be 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -317,11 +317,11 @@ const Experiment kExperiments[] = {
MULTI_VALUE_TYPE(kPrerenderFromOmniboxChoices)
},
{
- "enable-panels",
- IDS_FLAGS_ENABLE_PANELS_NAME,
- IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
+ "disable-panels",
+ IDS_FLAGS_DISABLE_PANELS_NAME,
+ IDS_FLAGS_DISABLE_PANELS_DESCRIPTION,
kOsAll,
- SINGLE_VALUE_TYPE(switches::kEnablePanels)
+ SINGLE_VALUE_TYPE(switches::kDisablePanels)
},
{
"disable-shortcuts-provider",
diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc
index e7382a2..71d3b83 100644
--- a/chrome/browser/extensions/extension_tabs_module.cc
+++ b/chrome/browser/extensions/extension_tabs_module.cc
@@ -31,7 +31,6 @@
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/browser/ui/browser_window.h"
-#include "chrome/browser/ui/panels/panel_manager.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/browser/ui/window_sizer.h"
#include "chrome/browser/web_applications/web_app.h"
@@ -462,11 +461,13 @@ bool CreateWindowFunction::RunImpl() {
window_type = Browser::TYPE_POPUP;
extension_id = GetExtension()->id();
} else if (type_str == keys::kWindowTypeValuePanel) {
- extension_id = GetExtension()->id();
- if (PanelManager::ShouldUsePanels(extension_id))
- window_type = Browser::TYPE_PANEL;
- else
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisablePanels)) {
window_type = Browser::TYPE_POPUP;
+ } else {
+ window_type = Browser::TYPE_PANEL;
+ }
+ extension_id = GetExtension()->id();
} else if (type_str != keys::kWindowTypeValueNormal) {
error_ = keys::kInvalidWindowTypeError;
return false;
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index d5302ec..e5006e6 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -476,10 +476,8 @@ Browser* Browser::CreateForApp(Type type,
RegisterAppPrefs(app_name, profile);
-#if !defined(OS_CHROMEOS) || defined(USE_AURA)
if (type == TYPE_PANEL &&
- !PanelManager::ShouldUsePanels(
- web_app::GetExtensionIdFromApplicationName(app_name))) {
+ CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisablePanels)) {
type = TYPE_POPUP;
}
#if defined(TOOLKIT_GTK)
@@ -495,7 +493,6 @@ Browser* Browser::CreateForApp(Type type,
}
}
#endif // TOOLKIT_GTK
-#endif // !OS_CHROMEOS || USE_AURA
CreateParams params(type, profile);
params.app_name = app_name;
@@ -4283,6 +4280,8 @@ gfx::Rect Browser::GetInstantBounds() {
BrowserWindow* Browser::CreateBrowserWindow() {
#if !defined(OS_CHROMEOS) || defined(USE_AURA)
if (type_ == TYPE_PANEL) {
+ DCHECK(!CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisablePanels));
return PanelManager::GetInstance()->CreatePanel(this);
}
#endif
diff --git a/chrome/browser/ui/panels/panel_manager.cc b/chrome/browser/ui/panels/panel_manager.cc
index 4b65f3f..79cdf3a 100644
--- a/chrome/browser/ui/panels/panel_manager.cc
+++ b/chrome/browser/ui/panels/panel_manager.cc
@@ -4,7 +4,6 @@
#include "chrome/browser/ui/panels/panel_manager.h"
-#include "base/command_line.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/fullscreen.h"
@@ -15,8 +14,6 @@
#include "chrome/browser/ui/panels/panel_strip.h"
#include "chrome/browser/ui/window_sizer.h"
#include "chrome/common/chrome_notification_types.h"
-#include "chrome/common/chrome_switches.h"
-#include "chrome/common/chrome_version_info.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
@@ -40,22 +37,6 @@ PanelManager* PanelManager::GetInstance() {
return instance.Pointer();
}
-// static
-bool PanelManager::ShouldUsePanels(const std::string& extension_id) {
- chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
- if (channel == chrome::VersionInfo::CHANNEL_STABLE ||
- channel == chrome::VersionInfo::CHANNEL_BETA) {
- return CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnablePanels) ||
- extension_id == std::string("nckgahadagoaajjgafhacjanaoiihapd") ||
- extension_id == std::string("ljclpkphhpbpinifbeabbhlfddcpfdde") ||
- extension_id == std::string("ppleadejekpmccmnpjdimmlfljlkdfej") ||
- extension_id == std::string("eggnbpckecmjlblplehfpjjdhhidfdoj");
- }
-
- return true;
-}
-
PanelManager::PanelManager()
: panel_mouse_watcher_(PanelMouseWatcher::Create()),
auto_sizing_enabled_(true),
diff --git a/chrome/browser/ui/panels/panel_manager.h b/chrome/browser/ui/panels/panel_manager.h
index 453d5a4..b78cb9e 100644
--- a/chrome/browser/ui/panels/panel_manager.h
+++ b/chrome/browser/ui/panels/panel_manager.h
@@ -35,9 +35,6 @@ class PanelManager : public AutoHidingDesktopBar::Observer {
// Returns a single instance.
static PanelManager* GetInstance();
- // Returns true if panels should be used for the extension.
- static bool ShouldUsePanels(const std::string& extension_id);
-
// Called when the display is changed, i.e. work area is updated.
void OnDisplayChanged();
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index d76c1c5..bf4e4ab 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -300,6 +300,9 @@ const char kDisableIPv6[] = "disable-ipv6";
// attempt to use the existing connection.
const char kDisableIPPooling[] = "disable-ip-pooling";
+// Disables panels (always on-top docked pop-up windows).
+const char kDisablePanels[] = "disable-panels";
+
// Disable speculative TCP/IP preconnection.
const char kDisablePreconnect[] = "disable-preconnect";
@@ -520,9 +523,6 @@ const char kEnableNaCl[] = "enable-nacl";
// Enables debugging via RSP over a socket.
const char kEnableNaClDebug[] = "enable-nacl-debug";
-// Enables panels (always on-top docked pop-up windows).
-const char kEnablePanels[] = "enable-panels";
-
// Enables advanced app capabilities.
const char kEnablePlatformApps[] = "enable-platform-apps";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index ec50638..2517477 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -90,6 +90,7 @@ extern const char kDisableInteractiveFormValidation[];
extern const char kDisableInternalFlash[];
extern const char kDisableIPv6[];
extern const char kDisableIPPooling[];
+extern const char kDisablePanels[];
extern const char kDisablePreconnect[];
extern const char kDisablePromptOnRepost[];
extern const char kDisableRemoteFonts[];
@@ -149,7 +150,6 @@ extern const char kEnableMacCookies[];
extern const char kEnableMemoryInfo[];
extern const char kEnableNaCl[];
extern const char kEnableNaClDebug[];
-extern const char kEnablePanels[];
extern const char kEnablePlatformApps[];
extern const char kEnablePreconnect[];
extern const char kEnableProfiling[];