Commit 841c14b4 authored by tapted's avatar tapted Committed by Commit bot

Disable extension Panels on Dev and Canary, except for the whitelist

They're already disabled on Beta and Stable channels. Leaving them
enabled in Dev/Canary confuses users and makes people suspect
regressions.

After this, panels are only enabled when --enable-panels is set in
chrome://flags and for the whitelist (Hangouts).

CL also tries to consolidate all the Hangouts extension IDs scattered
around the codebase.

BUG=467808, 526708

Review URL: https://codereview.chromium.org/1329033002

Cr-Commit-Position: refs/heads/master@{#347847}
parent 3e2b0516
......@@ -37,15 +37,6 @@ namespace {
const char kImageSizePath[] = "s64-p/";
const char kEmailUrlPrefix[] = "mailto:";
const char* const kHangoutsExtensionIds[] = {
"nckgahadagoaajjgafhacjanaoiihapd",
"ljclpkphhpbpinifbeabbhlfddcpfdde",
"ppleadejekpmccmnpjdimmlfljlkdfej",
"eggnbpckecmjlblplehfpjjdhhidfdoj",
"jfjjdfefebklmdbmenmlehlopoocnoeh",
"knipolnnllmklapflnccelgolnpehhpl"
};
// Add a query parameter to specify the size to fetch the image in. The
// original profile image can be of an arbitrary size, we ask the server to
// crop it to a square 64x64 using its smart cropping algorithm.
......@@ -188,12 +179,10 @@ void PeopleResult::SendEmail() {
}
void PeopleResult::RefreshHangoutsExtensionId() {
// TODO(rkc): Change this once we remove the hangoutsPrivate API.
// See crbug.com/306672
for (size_t i = 0; i < arraysize(kHangoutsExtensionIds); ++i) {
if (extensions::EventRouter::Get(profile_)->ExtensionHasEventListener(
kHangoutsExtensionIds[i], OnHangoutRequested::kEventName)) {
hangouts_extension_id_ = kHangoutsExtensionIds[i];
for (const char* id : extension_misc::kHangoutsExtensionIds) {
if (extensions::EventRouter::Get(profile_)
->ExtensionHasEventListener(id, OnHangoutRequested::kEventName)) {
hangouts_extension_id_ = id;
return;
}
}
......
......@@ -21,6 +21,7 @@
#include "components/version_info/version_info.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
#include "extensions/common/constants.h"
#include "ui/base/hit_test.h"
#if defined(USE_X11) && !defined(OS_CHROMEOS)
......@@ -104,13 +105,13 @@ void PanelManager::SetDisplaySettingsProviderForTesting(
// static
bool PanelManager::ShouldUsePanels(const std::string& extension_id) {
#if defined(USE_X11) && !defined(OS_CHROMEOS)
// If --enable-panels is on, always use panels on Linux.
// If --enable-panels is on, always use panels.
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnablePanels))
return true;
// Otherwise, panels are only supported on tested window managers.
#if defined(USE_X11) && !defined(OS_CHROMEOS)
// On Linux, panels are only supported on tested window managers.
ui::WindowManagerName wm_type = ui::GuessWindowManager();
if (wm_type != ui::WM_COMPIZ &&
wm_type != ui::WM_ICE_WM &&
......@@ -123,18 +124,13 @@ bool PanelManager::ShouldUsePanels(const std::string& extension_id) {
}
#endif // USE_X11 && !OS_CHROMEOS
version_info::Channel channel = chrome::GetChannel();
if (channel == version_info::Channel::STABLE ||
channel == version_info::Channel::BETA) {
return base::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");
// Without --enable-panels, only support Hangouts.
for (const char* id : extension_misc::kHangoutsExtensionIds) {
if (extension_id == id)
return true;
}
return true;
return false;
}
// static
......
......@@ -482,13 +482,14 @@
"channel": "stable",
"contexts": ["blessed_extension"],
"whitelist": [
// http://crbug.com/309737
"nckgahadagoaajjgafhacjanaoiihapd",
"ljclpkphhpbpinifbeabbhlfddcpfdde",
"ppleadejekpmccmnpjdimmlfljlkdfej",
"eggnbpckecmjlblplehfpjjdhhidfdoj",
"jfjjdfefebklmdbmenmlehlopoocnoeh",
"knipolnnllmklapflnccelgolnpehhpl"
// http://crbug.com/309737.
// Keep this list in sync with extensions_misc::kHangoutsExtensionIds.
"nckgahadagoaajjgafhacjanaoiihapd", // Hangouts Production.
"ljclpkphhpbpinifbeabbhlfddcpfdde", // Hangouts Debug.
"ppleadejekpmccmnpjdimmlfljlkdfej", // Hangouts Alpha.
"eggnbpckecmjlblplehfpjjdhhidfdoj", // Hangouts Beta.
"jfjjdfefebklmdbmenmlehlopoocnoeh", // Hangouts Packaged App Debug.
"knipolnnllmklapflnccelgolnpehhpl" // Hangouts Packaged App Prod.
]
},
"history": {
......
......@@ -30,10 +30,13 @@
"extension_types": ["platform_app"],
"min_manifest_version": 2,
"whitelist": [
"nckgahadagoaajjgafhacjanaoiihapd", // Google Talk prod
"eggnbpckecmjlblplehfpjjdhhidfdoj", // Google Talk beta
"ppleadejekpmccmnpjdimmlfljlkdfej", // Google Talk alpha
"ljclpkphhpbpinifbeabbhlfddcpfdde", // Google Talk debug
// Keep this list in sync with extensions_misc::kHangoutsExtensionIds but
// omit the Packaged App ids.
"nckgahadagoaajjgafhacjanaoiihapd", // Hangouts Production.
"ljclpkphhpbpinifbeabbhlfddcpfdde", // Hangouts Debug.
"ppleadejekpmccmnpjdimmlfljlkdfej", // Hangouts Alpha.
"eggnbpckecmjlblplehfpjjdhhidfdoj", // Hangouts Beta.
"lphgohfeebnhcpiohjndkgbhhkoapkjc" // Apps Debugger
]
},
......@@ -179,7 +182,7 @@
"channel": "stable",
"extension_types": [
"platform_app"
]
]
},
"launcher_page": {
"channel": "stable",
......
......@@ -93,4 +93,15 @@ const char kQuickOfficeExtensionId[] = "gbkeegbaiigmenfmjfclcdgdpimamgkj";
const char kMimeHandlerPrivateTestExtensionId[] =
"oickdpebdnfbgkcaoklfcdhjniefkcji";
const char kProdHangoutsExtensionId[] = "nckgahadagoaajjgafhacjanaoiihapd";
const char* const kHangoutsExtensionIds[6] = {
kProdHangoutsExtensionId,
"ljclpkphhpbpinifbeabbhlfddcpfdde", // Debug.
"ppleadejekpmccmnpjdimmlfljlkdfej", // Alpha.
"eggnbpckecmjlblplehfpjjdhhidfdoj", // Beta.
"jfjjdfefebklmdbmenmlehlopoocnoeh", // Packaged App Debug.
"knipolnnllmklapflnccelgolnpehhpl" // Packaged App Prod.
// Keep in sync with _api_features.json and _manifest_features.json.
};
} // namespace extension_misc
......@@ -223,6 +223,12 @@ extern const char kQuickOfficeExtensionId[];
// The extension id used for testing mimeHandlerPrivate.
extern const char kMimeHandlerPrivateTestExtensionId[];
// The extension id for the production version of Hangouts.
extern const char kProdHangoutsExtensionId[];
// Extension ids used by Hangouts.
extern const char* const kHangoutsExtensionIds[6];
} // namespace extension_misc
#endif // EXTENSIONS_COMMON_CONSTANTS_H_
......@@ -78,7 +78,7 @@ bool PermissionsData::ScriptsMayRequireActionForExtension(
bool PermissionsData::ShouldSkipPermissionWarnings(
const std::string& extension_id) {
// See http://b/4946060 for more details.
return extension_id == std::string("nckgahadagoaajjgafhacjanaoiihapd");
return extension_id == extension_misc::kProdHangoutsExtensionId;
}
// static
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment