summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Wu <rob@robwu.nl>2015-03-09 18:50:36 +0100
committerRob Wu <rob@robwu.nl>2015-03-09 17:51:07 +0000
commitc7d7f5d0bb261a3eec643bff40224c6078b62b32 (patch)
treed15ee32d3520bb21dc2cda5a6a5e628f18b0e8e4
parente81348ca44699e0c03b04d42815b927e9dddc844 (diff)
downloadchromium_src-c7d7f5d0bb261a3eec643bff40224c6078b62b32.zip
chromium_src-c7d7f5d0bb261a3eec643bff40224c6078b62b32.tar.gz
chromium_src-c7d7f5d0bb261a3eec643bff40224c6078b62b32.tar.bz2
Remove all remaining traces of chrome.infobars
And re-enable ExtensionApiTest.WindowOpen, to verify that the new test is effective. This test was introduced by crbug.com/52298, but disabled by crbug.com/64899. The test is supposed to check whether a tab that is opened via window.open() from an extension process associated with a particular Browser is opened in a non-incognito browser when 'incognito' is not set to 'split' (but the default, 'spanning'). BUG=458325,64899 R=rdevlin.cronin@chromium.org,sky@chromium.org Review URL: https://codereview.chromium.org/942873003 Cr-Commit-Position: refs/heads/master@{#317509} (cherry picked from commit f8cd8ced6c6681a5e161a476f3cd5ecb8568cb19) Review URL: https://codereview.chromium.org/988303004 Cr-Commit-Position: refs/branch-heads/2311@{#182} Cr-Branched-From: 09b7de5dd7254947cd4306de907274fa63373d48-refs/heads/master@{#317474}
-rw-r--r--chrome/browser/browser_resources.grd6
-rw-r--r--chrome/browser/extensions/chrome_extension_function_details.h6
-rw-r--r--chrome/browser/extensions/window_open_apitest.cc14
-rw-r--r--chrome/browser/resources/extensions_infobar.css15
-rw-r--r--chrome/browser/resources/extensions_infobar_mac.css15
-rw-r--r--chrome/common/extensions/api/_api_features.json4
-rw-r--r--chrome/common/extensions/api/_permission_features.json21
-rw-r--r--chrome/common/extensions/api/tab_capture.idl2
-rw-r--r--chrome/common/extensions/permissions/chrome_api_permissions.cc1
-rw-r--r--chrome/common/extensions/permissions/permission_set_unittest.cc1
-rw-r--r--chrome/test/data/extensions/api_test/window_open/spanning/background.js21
-rw-r--r--chrome/test/data/extensions/api_test/window_open/spanning/manifest.json5
-rw-r--r--chrome/test/data/extensions/api_test/window_open/spanning/popup.html (renamed from chrome/test/data/extensions/api_test/window_open/spanning/infobar.html)2
-rw-r--r--chrome/test/data/extensions/api_test/window_open/spanning/popup.js (renamed from chrome/test/data/extensions/api_test/window_open/spanning/infobar.js)7
-rw-r--r--extensions/common/permissions/api_permission.h1
15 files changed, 38 insertions, 83 deletions
diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd
index 7cc4156..c17a533 100644
--- a/chrome/browser/browser_resources.grd
+++ b/chrome/browser/browser_resources.grd
@@ -134,12 +134,6 @@
</if>
<if expr="enable_extensions">
<include name="IDR_EXTENSION_COMMAND_LIST_JS" file="resources\extensions\extension_command_list.js" flattenhtml="true" type="BINDATA" />
- <if expr="is_macosx">
- <include name="IDR_EXTENSIONS_INFOBAR_CSS" file="resources\extensions_infobar_mac.css" flattenhtml="true" type="BINDATA" />
- </if>
- <if expr="not is_macosx">
- <include name="IDR_EXTENSIONS_INFOBAR_CSS" file="resources\extensions_infobar.css" flattenhtml="true" type="BINDATA" />
- </if>
<include name="IDR_EXTENSION_LIST_JS" file="resources\extensions\extension_list.js" flattenhtml="true" type="BINDATA" />
<include name="IDR_EXTENSIONS_JS" file="resources\extensions\extensions.js" flattenhtml="true" type="BINDATA" />
</if>
diff --git a/chrome/browser/extensions/chrome_extension_function_details.h b/chrome/browser/extensions/chrome_extension_function_details.h
index 79c5c09..2484158 100644
--- a/chrome/browser/extensions/chrome_extension_function_details.h
+++ b/chrome/browser/extensions/chrome_extension_function_details.h
@@ -38,9 +38,9 @@ class ChromeExtensionFunctionDetails {
// Gets the "current" browser, if any.
//
// Many extension APIs operate relative to the current browser, which is the
- // browser the calling code is running inside of. For example, popups, tabs,
- // and infobars all have a containing browser, but background pages and
- // notification bubbles do not.
+ // browser the calling code is running inside of. For example, popups and tabs
+ // all have a containing browser, but background pages and notification
+ // bubbles do not.
//
// If there is no containing window, the current browser defaults to the
// foremost one.
diff --git a/chrome/browser/extensions/window_open_apitest.cc b/chrome/browser/extensions/window_open_apitest.cc
index 0c9aacd..011ff07 100644
--- a/chrome/browser/extensions/window_open_apitest.cc
+++ b/chrome/browser/extensions/window_open_apitest.cc
@@ -46,11 +46,15 @@ using content::OpenURLParams;
using content::Referrer;
using content::WebContents;
-// Disabled, http://crbug.com/64899.
-IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_WindowOpen) {
- base::CommandLine::ForCurrentProcess()->AppendSwitch(
- extensions::switches::kEnableExperimentalExtensionApis);
-
+// The test uses the chrome.browserAction.openPopup API, which requires that the
+// window can automatically be activated.
+// See comments at BrowserActionInteractiveTest::ShouldRunPopupTest
+#if defined(OS_MACOSX)
+#define MAYBE_WindowOpen DISABLED_WindowOpen
+#else
+#define MAYBE_WindowOpen WindowOpen
+#endif
+IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_WindowOpen) {
extensions::ResultCatcher catcher;
ASSERT_TRUE(LoadExtensionIncognito(test_data_dir_
.AppendASCII("window_open").AppendASCII("spanning")));
diff --git a/chrome/browser/resources/extensions_infobar.css b/chrome/browser/resources/extensions_infobar.css
deleted file mode 100644
index 5958777..0000000
--- a/chrome/browser/resources/extensions_infobar.css
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file. */
-
-/**
- * The following style rules affect Extension Infobars.
- */
-
-body {
- background: -webkit-linear-gradient(#E9E9E9, #DADADA);
- font-size: 11px;
- height: 36px; /* Infobars are limited to 36-72px */
- margin: 0;
- overflow: hidden;
-}
diff --git a/chrome/browser/resources/extensions_infobar_mac.css b/chrome/browser/resources/extensions_infobar_mac.css
deleted file mode 100644
index 7dfadd5..0000000
--- a/chrome/browser/resources/extensions_infobar_mac.css
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file. */
-
-/**
- * The following style rules affect Extension Infobars on the Mac.
- */
-
-body {
- background: -webkit-linear-gradient(#ebebeb, #cfcfcf);
- font-size: 12px;
- height: 36px; /* Infobars are limited to 36-72px */
- margin: 0 38px;
- overflow: hidden;
-}
diff --git a/chrome/common/extensions/api/_api_features.json b/chrome/common/extensions/api/_api_features.json
index 55767b1..a101d84 100644
--- a/chrome/common/extensions/api/_api_features.json
+++ b/chrome/common/extensions/api/_api_features.json
@@ -466,10 +466,6 @@
"dependencies": ["permission:idltest"],
"contexts": ["blessed_extension"]
},
- "infobars": {
- "dependencies": ["permission:infobars"],
- "contexts": ["blessed_extension"]
- },
"inlineInstallPrivate": {
"dependencies": ["permission:inlineInstallPrivate"],
"contexts": ["blessed_extension"]
diff --git a/chrome/common/extensions/api/_permission_features.json b/chrome/common/extensions/api/_permission_features.json
index e684aeb..9ed71db 100644
--- a/chrome/common/extensions/api/_permission_features.json
+++ b/chrome/common/extensions/api/_permission_features.json
@@ -523,27 +523,6 @@
"channel": "trunk",
"extension_types": ["extension"]
},
- "infobars": [
- {
- "channel": "dev",
- "extension_types": ["extension", "legacy_packaged_app", "platform_app"]
- },
- {
- "channel": "stable",
- "extension_types": ["extension"],
- "whitelist": [
- "496B6890097EB6E19809ADEADD095A8721FBB2E0" // crbug.com/415852
- ]
- },
- {
- "channel": "stable",
- "extension_types": ["extension"],
- "whitelist": [
- "E24F1786D842E91E74C27929B0B3715A4689A473" // crbug.com/415852
- ],
- "location": "component"
- }
- ],
"input": {
"channel": "stable",
"extension_types": ["extension", "legacy_packaged_app"],
diff --git a/chrome/common/extensions/api/tab_capture.idl b/chrome/common/extensions/api/tab_capture.idl
index 978c235..c6489d6 100644
--- a/chrome/common/extensions/api/tab_capture.idl
+++ b/chrome/common/extensions/api/tab_capture.idl
@@ -71,7 +71,7 @@ namespace tabCapture {
interface Events {
// Event fired when the capture status of a tab changes.
// This allows extension authors to keep track of the capture status of
- // tabs to keep UI elements like page actions and infobars in sync.
+ // tabs to keep UI elements like page actions in sync.
// |info| : CaptureInfo with new capture status for the tab.
static void onStatusChanged(CaptureInfo info);
};
diff --git a/chrome/common/extensions/permissions/chrome_api_permissions.cc b/chrome/common/extensions/permissions/chrome_api_permissions.cc
index 0e50e6e..50ec161 100644
--- a/chrome/common/extensions/permissions/chrome_api_permissions.cc
+++ b/chrome/common/extensions/permissions/chrome_api_permissions.cc
@@ -127,7 +127,6 @@ std::vector<APIPermissionInfo*> ChromeAPIPermissions::GetAllPermissions()
IDS_EXTENSION_PROMPT_WARNING_HISTORY_WRITE,
PermissionMessage::kBrowsingHistory},
{APIPermission::kIdltest, "idltest"},
- {APIPermission::kInfobars, "infobars"},
{APIPermission::kInput,
"input",
APIPermissionInfo::kFlagNone,
diff --git a/chrome/common/extensions/permissions/permission_set_unittest.cc b/chrome/common/extensions/permissions/permission_set_unittest.cc
index d4bfb1d..e101bff 100644
--- a/chrome/common/extensions/permissions/permission_set_unittest.cc
+++ b/chrome/common/extensions/permissions/permission_set_unittest.cc
@@ -742,7 +742,6 @@ TEST(PermissionsTest, PermissionMessages) {
skip.insert(APIPermission::kGcdPrivate);
skip.insert(APIPermission::kHotwordPrivate);
skip.insert(APIPermission::kIdentityPrivate);
- skip.insert(APIPermission::kInfobars);
skip.insert(APIPermission::kInputMethodPrivate);
skip.insert(APIPermission::kMediaPlayerPrivate);
skip.insert(APIPermission::kMetricsPrivate);
diff --git a/chrome/test/data/extensions/api_test/window_open/spanning/background.js b/chrome/test/data/extensions/api_test/window_open/spanning/background.js
index 582b5b6..f851f63 100644
--- a/chrome/test/data/extensions/api_test/window_open/spanning/background.js
+++ b/chrome/test/data/extensions/api_test/window_open/spanning/background.js
@@ -13,8 +13,14 @@ function openFromNormalShouldOpenInNormal() {
chrome.test.assertEq(1, windows[0].tabs.length);
chrome.test.assertFalse(windows[0].tabs[0].incognito);
- // The rest of the test continues in infobar.html.
- chrome.infobars.show({tabId: windows[0].tabs[0].id, path: "infobar.html"});
+ chrome.windows.update(windows[0].id, {
+ focused: true
+ }, function() {
+ chrome.browserAction.openPopup(function(popupWindow) {
+ chrome.test.assertTrue(!!popupWindow);
+ // The rest of the test continues in popup.html.
+ });
+ });
});
}
@@ -23,14 +29,19 @@ function openFromExtensionHostInIncognitoBrowserShouldOpenInNormalBrowser() {
chrome.windows.getCurrent(function(normalWin) {
chrome.test.assertFalse(normalWin.incognito);
// Create an incognito window.
- chrome.windows.create({ incognito: true }, function(incognitoWin) {
+ chrome.windows.create({
+ incognito: true,
+ focused: true
+ }, function(incognitoWin) {
// Remove the normal window. We keep running because of the incognito
// window.
chrome.windows.remove(normalWin.id, function() {
chrome.tabs.getAllInWindow(incognitoWin.id, function(tabs) {
chrome.test.assertEq(1, tabs.length);
- // The rest of the test continues in infobar.html.
- chrome.infobars.show({tabId: tabs[0].id, path: "infobar.html"});
+ chrome.browserAction.openPopup(function(popupWindow) {
+ chrome.test.assertTrue(!!popupWindow);
+ // The rest of the test continues in popup.html.
+ });
});
});
});
diff --git a/chrome/test/data/extensions/api_test/window_open/spanning/manifest.json b/chrome/test/data/extensions/api_test/window_open/spanning/manifest.json
index fe49d28..585fe3d 100644
--- a/chrome/test/data/extensions/api_test/window_open/spanning/manifest.json
+++ b/chrome/test/data/extensions/api_test/window_open/spanning/manifest.json
@@ -2,7 +2,10 @@
"name": "window.open test - spanning",
"version": "1",
"manifest_version": 2,
- "permissions": ["infobars", "tabs"],
+ "permissions": ["tabs"],
+ "browser_action": {
+ "default_popup": "popup.html"
+ },
"background": {
"scripts": ["background.js"]
}
diff --git a/chrome/test/data/extensions/api_test/window_open/spanning/infobar.html b/chrome/test/data/extensions/api_test/window_open/spanning/popup.html
index 48e30ac..4cd6831 100644
--- a/chrome/test/data/extensions/api_test/window_open/spanning/infobar.html
+++ b/chrome/test/data/extensions/api_test/window_open/spanning/popup.html
@@ -3,4 +3,4 @@
* source code is governed by a BSD-style license that can be found in the
* LICENSE file.
-->
-<script src="infobar.js"></script>
+<script src="popup.js"></script>
diff --git a/chrome/test/data/extensions/api_test/window_open/spanning/infobar.js b/chrome/test/data/extensions/api_test/window_open/spanning/popup.js
index ecbc558..cf5b2ca 100644
--- a/chrome/test/data/extensions/api_test/window_open/spanning/infobar.js
+++ b/chrome/test/data/extensions/api_test/window_open/spanning/popup.js
@@ -2,8 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-chrome.tabs.onCreated.addListener(function() {
- chrome.tabs.onCreated.removeListener(arguments.callee);
- chrome.extension.getBackgroundPage().verifyCreatedTab.apply(null, arguments);
+chrome.tabs.onCreated.addListener(function onCreated(tab) {
+ chrome.tabs.onCreated.removeListener(onCreated);
+ chrome.extension.getBackgroundPage().verifyCreatedTab(tab);
});
window.open('foo.html');
+window.close();
diff --git a/extensions/common/permissions/api_permission.h b/extensions/common/permissions/api_permission.h
index 9c6712d..23a8c82 100644
--- a/extensions/common/permissions/api_permission.h
+++ b/extensions/common/permissions/api_permission.h
@@ -131,7 +131,6 @@ class APIPermission {
kIdltest,
kIdle,
kImeWindowEnabled,
- kInfobars,
kInlineInstallPrivate,
kInput,
kInputMethodPrivate,