diff options
author | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-27 07:56:43 +0000 |
---|---|---|
committer | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-27 07:56:43 +0000 |
commit | 22991bed3fe4146efc22ae368f3637edd3f8182e (patch) | |
tree | f5592aea6db444845a933b711c41ff56c787d693 | |
parent | a47a6fe323a07681d3a0715660b1a9c6515ec9c9 (diff) | |
download | chromium_src-22991bed3fe4146efc22ae368f3637edd3f8182e.zip chromium_src-22991bed3fe4146efc22ae368f3637edd3f8182e.tar.gz chromium_src-22991bed3fe4146efc22ae368f3637edd3f8182e.tar.bz2 |
Revert 90496 - Probable cause of InstantTest.On[Change/Submit/Cancel]Event failures.
Added a private chromeAuthPrivate API.
Ceated a component hosted app that uses this to set cloud print credentials.
BUG=None
TEST=Unit-tests
Review URL: http://codereview.chromium.org/7253001
TBR=sanjeevr@chromium.org
Review URL: http://codereview.chromium.org/7264016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90547 0039d316-1c4b-4281-b951-d872f2087c98
28 files changed, 27 insertions, 403 deletions
diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd index e1043f7..33f4555 100644 --- a/chrome/browser/browser_resources.grd +++ b/chrome/browser/browser_resources.grd @@ -89,7 +89,6 @@ <include name="IDR_BUGREPORT_HTML" file="resources\bug_report.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_BUGREPORT_HTML_INVALID" file="resources\bug_report_invalid.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_WEBSTORE_MANIFEST" file="resources\webstore_app\manifest.json" type="BINDATA" /> - <include name="IDR_CLOUDPRINT_MANIFEST" file="resources\cloud_print_app\manifest.json" type="BINDATA" /> <if expr="pp_ifdef('chromeos')"> <include name="IDR_ABOUT_SYS_HTML" file="resources\about_sys.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_CHOOSE_MOBILE_NETWORK_HTML" file="resources\chromeos\choose_mobile_network.html" flattenhtml="true" type="BINDATA" /> diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 10bc86a..cff371e 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -259,7 +259,6 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( switches::kAllowScriptingGallery, switches::kAppsCheckoutURL, switches::kAppsGalleryURL, - switches::kCloudPrintServiceURL, switches::kDebugPrint, #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS) && !defined(OS_MACOSX) // Enabled by default in Google Chrome builds, except on CrOS. diff --git a/chrome/browser/extensions/extension_chrome_auth_private_api.cc b/chrome/browser/extensions/extension_chrome_auth_private_api.cc deleted file mode 100644 index 79bae39..0000000 --- a/chrome/browser/extensions/extension_chrome_auth_private_api.cc +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) 2011 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. - -#include "chrome/browser/extensions/extension_chrome_auth_private_api.h" - -#include <string> -#include "base/values.h" -#include "chrome/browser/extensions/extension_service.h" -#include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" - -namespace { - -bool IsCloudPrintEnableURL(Profile* profile, const GURL& url) { - ExtensionService* service = profile->GetExtensionService(); - const Extension* cloud_print_app = service->GetExtensionById( - extension_misc::kCloudPrintAppId, false); - if (!cloud_print_app) { - NOTREACHED(); - return false; - } - return (service->GetExtensionByWebExtent(url) == cloud_print_app); -} - -bool test_mode = false; - -const char kAccessDeniedError[] = - "Cannot call this API from a non-cloudprint URL."; -} // namespace - -SetCloudPrintCredentialsFunction::SetCloudPrintCredentialsFunction() { -} - -SetCloudPrintCredentialsFunction::~SetCloudPrintCredentialsFunction() { -} - -bool SetCloudPrintCredentialsFunction::RunImpl() { - // This has to be called from the specific cloud print app. - if (!IsCloudPrintEnableURL(profile_, source_url())) { - error_ = kAccessDeniedError; - return false; - } - - std::string user_email; - EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &user_email)); - std::string robot_email; - EXTENSION_FUNCTION_VALIDATE(args_->GetString(1, &robot_email)); - std::string credentials; - EXTENSION_FUNCTION_VALIDATE(args_->GetString(2, &credentials)); - if (test_mode) { - std::string test_response = user_email; - test_response.append(robot_email); - test_response.append(credentials); - result_.reset(Value::CreateStringValue(test_response)); - } else { - profile_->GetCloudPrintProxyService()->EnableForUserWithRobot( - credentials, robot_email, user_email); - } - SendResponse(true); - return true; -} - -// static -void SetCloudPrintCredentialsFunction::SetTestMode(bool test_mode_enabled) { - test_mode = test_mode_enabled; -} diff --git a/chrome/browser/extensions/extension_chrome_auth_private_api.h b/chrome/browser/extensions/extension_chrome_auth_private_api.h deleted file mode 100644 index d5f6629..0000000 --- a/chrome/browser/extensions/extension_chrome_auth_private_api.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 2011 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. - -#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_CHROME_AUTH_PRIVATE_API_H_ -#define CHROME_BROWSER_EXTENSIONS_EXTENSION_CHROME_AUTH_PRIVATE_API_H_ -#pragma once - -#include <string> -#include "chrome/browser/extensions/extension_function.h" - -class SetCloudPrintCredentialsFunction : public AsyncExtensionFunction { - public: - SetCloudPrintCredentialsFunction(); - - // For use only in tests - sets a flag that can cause this function to not - // actually set the credentials but instead simply reflect the passed in - // arguments appended together as one string back in results_. - static void SetTestMode(bool test_mode_enabled); - - protected: - virtual ~SetCloudPrintCredentialsFunction(); - - virtual bool RunImpl(); - - private: - DECLARE_EXTENSION_FUNCTION_NAME("chromeAuthPrivate.setCloudPrintCredentials"); -}; - - -#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_CHROME_AUTH_PRIVATE_API_H_ diff --git a/chrome/browser/extensions/extension_chrome_auth_private_apitest.cc b/chrome/browser/extensions/extension_chrome_auth_private_apitest.cc deleted file mode 100644 index ac7b11d..0000000 --- a/chrome/browser/extensions/extension_chrome_auth_private_apitest.cc +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) 2011 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. - -#include "base/stringprintf.h" -#include "chrome/browser/extensions/extension_apitest.h" -#include "chrome/browser/extensions/extension_chrome_auth_private_api.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/browser.h" -#include "chrome/common/chrome_switches.h" -#include "chrome/test/ui_test_utils.h" -#include "net/base/mock_host_resolver.h" - -// A base class for tests below. -class ExtensionChromeAuthPrivateApiTest : public ExtensionApiTest { - public: - void SetUpCommandLine(CommandLine* command_line) OVERRIDE { - ExtensionApiTest::SetUpCommandLine(command_line); - command_line->AppendSwitchASCII(switches::kCloudPrintServiceURL, - "http://www.cloudprintapp.com/files/extensions/api_test/" - "chrome_auth_private"); - } - - void SetUpInProcessBrowserTestFixture() OVERRIDE { - // Start up the test server and get us ready for calling the install - // API functions. - host_resolver()->AddRule("www.cloudprintapp.com", "127.0.0.1"); - ASSERT_TRUE(test_server()->Start()); - } - - protected: - // Returns a test server URL, but with host 'www.cloudprintapp.com' so it - // matches the cloud print app's extent that we set up via command line - // flags. - GURL GetTestServerURL(const std::string& path) { - GURL url = test_server()->GetURL( - "files/extensions/api_test/chrome_auth_private/" + path); - - // Replace the host with 'www.cloudprintapp.com' so it matches the cloud - // print app's extent. - GURL::Replacements replace_host; - std::string host_str("www.cloudprintapp.com"); - replace_host.SetHostStr(host_str); - return url.ReplaceComponents(replace_host); - } -}; - -IN_PROC_BROWSER_TEST_F(ExtensionChromeAuthPrivateApiTest, - SetCloudPrintCredentialsSuccessHosted) { - // Run this as a hosted app. Since we have overridden the cloud print service - // URL in the command line, this URL should match the web extent for our - // cloud print component app and it should work. - SetCloudPrintCredentialsFunction::SetTestMode(true); - GURL page_url = GetTestServerURL( - "enable_chrome_connector/cloud_print_success_tests.html"); - ASSERT_TRUE(RunPageTest(page_url.spec())); - SetCloudPrintCredentialsFunction::SetTestMode(false); -} - -IN_PROC_BROWSER_TEST_F(ExtensionChromeAuthPrivateApiTest, - SetCloudPrintCredentialsFailureInstalled) { - // Run this as an installed app. Since this is not a component app, it - // should fail. - ASSERT_TRUE(RunExtensionTest("chrome_auth_private/installed_app")); -} - -IN_PROC_BROWSER_TEST_F(ExtensionChromeAuthPrivateApiTest, - SetCloudPrintCredentialsFailureInstalledComponent) { - // Run this as an installed component app. This should also fail because of - // the explicit URL check in the API. - ASSERT_TRUE(RunComponentExtensionTest( - "chrome_auth_private/installed_component_app")); -} - diff --git a/chrome/browser/extensions/extension_function_dispatcher.cc b/chrome/browser/extensions/extension_function_dispatcher.cc index b0ac559..92aa0f7 100644 --- a/chrome/browser/extensions/extension_function_dispatcher.cc +++ b/chrome/browser/extensions/extension_function_dispatcher.cc @@ -16,7 +16,6 @@ #include "chrome/browser/extensions/extension_bookmark_manager_api.h" #include "chrome/browser/extensions/extension_bookmarks_module.h" #include "chrome/browser/extensions/extension_browser_actions_api.h" -#include "chrome/browser/extensions/extension_chrome_auth_private_api.h" #include "chrome/browser/extensions/extension_content_settings_api.h" #include "chrome/browser/extensions/extension_context_menu_api.h" #include "chrome/browser/extensions/extension_cookies_api.h" @@ -371,9 +370,6 @@ void FactoryRegistry::ResetFunctions() { RegisterFunction<ClearContentSettingsFunction>(); RegisterFunction<GetContentSettingFunction>(); RegisterFunction<SetContentSettingFunction>(); - - // ChromeAuth settings. - RegisterFunction<SetCloudPrintCredentialsFunction>(); } void FactoryRegistry::GetAllNames(std::vector<std::string>* names) { diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc index d531d5b..73adc7f 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc @@ -536,10 +536,6 @@ void ProfileImpl::RegisterComponentExtensions() { FILE_PATH_LITERAL("web_store"), IDR_WEBSTORE_MANIFEST)); - component_extensions.push_back(std::make_pair( - FILE_PATH_LITERAL("cloud_print"), - IDR_CLOUDPRINT_MANIFEST)); - for (ComponentExtensionList::iterator iter = component_extensions.begin(); iter != component_extensions.end(); ++iter) { FilePath path(iter->first); diff --git a/chrome/browser/resources/cloud_print_app/manifest.json b/chrome/browser/resources/cloud_print_app/manifest.json deleted file mode 100644 index d42bd4b..0000000 --- a/chrome/browser/resources/cloud_print_app/manifest.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDqOhnwk4+HXVfGyaNsAQdU/js1Na56diW08oF1MhZiwzSnJsEaeuMN9od9q9N4ZdK3o1xXOSARrYdE+syV7Dl31nf6qz3A6K+D5NHe6sSB9yvYlIiN37jdWdrfxxE0pRYEVYZNTe3bzq3NkcYJlOdt1UPcpJB+isXpAGUKUvt7EQIDAQAB", - "name": "Cloud Print", - "version": "0.1", - "description": "Cloud Print", - "icons": { - }, - "app": { - "launch": { - "web_url": "https://www.google.com/cloudprint/enable_chrome_connector" - }, - "urls": [ - "https://www.google.com/cloudprint/enable_chrome_connector" - ] - }, - "permissions": [ - "chromeAuthPrivate" - ] -} diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc index abf8094..5ca61e374 100644 --- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc +++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc @@ -226,12 +226,10 @@ void AppLauncherHandler::FillAppDictionary(DictionaryValue* dictionary) { const ExtensionList* extensions = extensions_service_->extensions(); ExtensionList::const_iterator it; for (it = extensions->begin(); it != extensions->end(); ++it) { - // Don't include the WebStore and the Cloud Print app. + // Don't include the WebStore. // The WebStore launcher gets special treatment in ntp/apps.js. - // The Cloud Print app should not be displayed in the NTP. if ((*it)->is_app() && - (*it)->id() != extension_misc::kWebStoreAppId && - (*it)->id() != extension_misc::kCloudPrintAppId) { + (*it)->id() != extension_misc::kWebStoreAppId) { DictionaryValue* app_info = new DictionaryValue(); CreateAppInfo(*it, extensions_service_->extension_prefs(), app_info); list->Append(app_info); @@ -241,8 +239,7 @@ void AppLauncherHandler::FillAppDictionary(DictionaryValue* dictionary) { extensions = extensions_service_->disabled_extensions(); for (it = extensions->begin(); it != extensions->end(); ++it) { if ((*it)->is_app() && - (*it)->id() != extension_misc::kWebStoreAppId && - (*it)->id() != extension_misc::kCloudPrintAppId) { + (*it)->id() != extension_misc::kWebStoreAppId) { DictionaryValue* app_info = new DictionaryValue(); CreateAppInfo(*it, extensions_service_->extension_prefs(), app_info); list->Append(app_info); diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 180c72f..1f50ea0 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -874,8 +874,6 @@ 'browser/extensions/extension_browser_actions_api.h', 'browser/extensions/extension_browser_event_router.cc', 'browser/extensions/extension_browser_event_router.h', - 'browser/extensions/extension_chrome_auth_private_api.cc', - 'browser/extensions/extension_chrome_auth_private_api.h', 'browser/extensions/extension_content_settings_api.cc', 'browser/extensions/extension_content_settings_api.h', 'browser/extensions/extension_content_settings_api_constants.cc', diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index 971f4e5..327756a 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -2395,7 +2395,6 @@ 'browser/extensions/extension_browsertest.cc', 'browser/extensions/extension_browsertest.h', 'browser/extensions/extension_browsertests_misc.cc', - 'browser/extensions/extension_chrome_auth_private_apitest.cc', 'browser/extensions/extension_clipboard_apitest.cc', 'browser/extensions/extension_content_settings_apitest.cc', 'browser/extensions/extension_context_menu_apitest.cc', diff --git a/chrome/common/extensions/api/extension_api.json b/chrome/common/extensions/api/extension_api.json index 929d0eb..d507be1 100644 --- a/chrome/common/extensions/api/extension_api.json +++ b/chrome/common/extensions/api/extension_api.json @@ -6170,47 +6170,5 @@ ] } ] - }, - { - "namespace": "chromeAuthPrivate", - "nodoc": "true", - "functions": [ - { - "name": "setCloudPrintCredentials", - "description": "Sets the login credentials for Cloud Print.", - "type": "function", - "parameters": [ - { - "name": "userEmail", - "type": "string", - "description": "The email address of the user." - }, - { - "name": "robotEmail", - "type": "string", - "description": "The email address of the robot account." - }, - { - "name": "credentials", - "type": "string", - "description": "The login credentials(OAuth2 Auth code)." - }, - { - "name": "callback", - "type": "function", - "description": "Called when a failure happens. Called upon success only in tests.", - "optional": "true", - "parameters": [ - { - "name": "result", - "type": "string", - "description": "A string result code. The value is non-empty on success only in tests.", - "optional": "true" - } - ] - } - ] - } - ] } ] diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc index 7ce536c..e98c5f0 100644 --- a/chrome/common/extensions/extension.cc +++ b/chrome/common/extensions/extension.cc @@ -274,29 +274,6 @@ ExtensionPermissionMessages Extension::GetPermissionMessages() const { return permission_set_->GetPermissionMessages(); } -void Extension::OverrideLaunchUrl(const GURL& override_url) { - GURL new_url(override_url); - if (!new_url.is_valid()) { - LOG(WARNING) << "Invalid override url given for " << name(); - } else { - if (new_url.has_port()) { - LOG(WARNING) << "Override URL passed for " << name() - << " should not contain a port. Removing it."; - - GURL::Replacements remove_port; - remove_port.ClearPort(); - new_url = new_url.ReplaceComponents(remove_port); - } - - launch_web_url_ = new_url.spec(); - - URLPattern pattern(kValidWebExtentSchemes); - pattern.Parse(new_url.spec(), URLPattern::PARSE_STRICT); - pattern.SetPath(pattern.path() + '*'); - extent_.AddPattern(pattern); - } -} - std::vector<string16> Extension::GetPermissionMessageStrings() const { return permission_set_->GetWarningMessages(); } @@ -1042,26 +1019,29 @@ bool Extension::LoadLaunchURL(const DictionaryValue* manifest, // Empty string means option was not used. if (!gallery_url_str.empty()) { GURL gallery_url(gallery_url_str); - OverrideLaunchUrl(gallery_url); - } - } else if (id() == extension_misc::kCloudPrintAppId) { - // In order for the --cloud-print-service switch to work, we must update - // the launch URL and web extent. - // TODO(sanjeevr): Ideally we want to use CloudPrintURL here but that is - // currently under chrome/browser. - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); - GURL cloud_print_service_url = GURL(command_line.GetSwitchValueASCII( - switches::kCloudPrintServiceURL)); - if (!cloud_print_service_url.is_empty()) { - std::string path( - cloud_print_service_url.path() + "/enable_chrome_connector"); - GURL::Replacements replacements; - replacements.SetPathStr(path); - GURL cloud_print_enable_connector_url = - cloud_print_service_url.ReplaceComponents(replacements); - OverrideLaunchUrl(cloud_print_enable_connector_url); + if (!gallery_url.is_valid()) { + LOG(WARNING) << "Invalid url given in switch " + << switches::kAppsGalleryURL; + } else { + if (gallery_url.has_port()) { + LOG(WARNING) << "URLs passed to switch " << switches::kAppsGalleryURL + << " should not contain a port. Removing it."; + + GURL::Replacements remove_port; + remove_port.ClearPort(); + gallery_url = gallery_url.ReplaceComponents(remove_port); + } + + launch_web_url_ = gallery_url.spec(); + + URLPattern pattern(kValidWebExtentSchemes); + pattern.Parse(gallery_url.spec(), URLPattern::PARSE_STRICT); + pattern.SetPath(pattern.path() + '*'); + extent_.AddPattern(pattern); + } } } + return true; } diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h index 4bfd709..7e584d7 100644 --- a/chrome/common/extensions/extension.h +++ b/chrome/common/extensions/extension.h @@ -620,10 +620,6 @@ class Extension : public base::RefCountedThreadSafe<Extension> { // component-private permission. bool IsComponentOnlyPermission(const ExtensionAPIPermission* api) const; - // Updates the launch URL and extents for the extension using the given - // |override_url|. - void OverrideLaunchUrl(const GURL& override_url); - // Cached images for this extension. This should only be touched on the UI // thread. mutable ImageCache image_cache_; diff --git a/chrome/common/extensions/extension_constants.cc b/chrome/common/extensions/extension_constants.cc index 0ab3293..4761639 100644 --- a/chrome/common/extensions/extension_constants.cc +++ b/chrome/common/extensions/extension_constants.cc @@ -407,7 +407,6 @@ const char* kDecodedMessageCatalogsFilename = "DECODED_MESSAGE_CATALOGS"; namespace extension_misc { const char* kBookmarkManagerId = "eemcgdkfndhakfknompkggombfjjjeno"; const char* kWebStoreAppId = "ahfgeienlihckogmohjhadlkjgocpleb"; -const char* kCloudPrintAppId = "mfehgcgbbipciphmccgaenjidiccnmng"; const char* kAppsPromoHistogram = "Extensions.AppsPromo"; const char* kAppLaunchHistogram = "Extensions.AppLaunch"; #if defined(OS_CHROMEOS) diff --git a/chrome/common/extensions/extension_constants.h b/chrome/common/extensions/extension_constants.h index 4b0e651..1fdd433 100644 --- a/chrome/common/extensions/extension_constants.h +++ b/chrome/common/extensions/extension_constants.h @@ -286,9 +286,6 @@ namespace extension_misc { // The extension id of the Web Store component application. extern const char* kWebStoreAppId; - // The extension id of the Cloud Print component application. - extern const char* kCloudPrintAppId; - // Note: this structure is an ASN.1 which encodes the algorithm used // with its parameters. This is defined in PKCS #1 v2.1 (RFC 3447). // It is encoding: { OID sha1WithRSAEncryption PARAMETERS NULL } diff --git a/chrome/common/extensions/extension_permission_set.cc b/chrome/common/extensions/extension_permission_set.cc index c829c10..d87e9e3 100644 --- a/chrome/common/extensions/extension_permission_set.cc +++ b/chrome/common/extensions/extension_permission_set.cc @@ -249,10 +249,6 @@ ExtensionPermissionsInfo::ExtensionPermissionsInfo() // Hosted app and private permissions. RegisterPermission( - ExtensionAPIPermission::kChromeAuthPrivate, "chromeAuthPrivate", 0, - ExtensionPermissionMessage::kNone, - true, true, false, false); - RegisterPermission( ExtensionAPIPermission::kWebstorePrivate, "webstorePrivate", 0, ExtensionPermissionMessage::kNone, true, true, false, false); diff --git a/chrome/common/extensions/extension_permission_set.h b/chrome/common/extensions/extension_permission_set.h index 8d6a8a0..14f58a90 100644 --- a/chrome/common/extensions/extension_permission_set.h +++ b/chrome/common/extensions/extension_permission_set.h @@ -99,7 +99,6 @@ class ExtensionAPIPermission { kContentSettings, kContextMenus, kCookie, - kChromeAuthPrivate, kChromePrivate, kChromeosInfoPrivate, kDebugger, diff --git a/chrome/common/extensions/extension_permission_set_unittest.cc b/chrome/common/extensions/extension_permission_set_unittest.cc index 75e12fa..9cfa698 100644 --- a/chrome/common/extensions/extension_permission_set_unittest.cc +++ b/chrome/common/extensions/extension_permission_set_unittest.cc @@ -162,7 +162,6 @@ TEST(ExtensionAPIPermissionTest, HostedAppPermissions) { hosted_perms.insert(ExtensionAPIPermission::kBackground); hosted_perms.insert(ExtensionAPIPermission::kClipboardRead); hosted_perms.insert(ExtensionAPIPermission::kClipboardWrite); - hosted_perms.insert(ExtensionAPIPermission::kChromeAuthPrivate); hosted_perms.insert(ExtensionAPIPermission::kChromePrivate); hosted_perms.insert(ExtensionAPIPermission::kExperimental); hosted_perms.insert(ExtensionAPIPermission::kGeolocation); @@ -178,14 +177,13 @@ TEST(ExtensionAPIPermissionTest, HostedAppPermissions) { EXPECT_EQ(hosted_perms.count(*i) > 0, info->GetByID(*i)->is_hosted_app()); } - EXPECT_EQ(10u, count); - EXPECT_EQ(10u, info->get_hosted_app_permission_count()); + EXPECT_EQ(9u, count); + EXPECT_EQ(9u, info->get_hosted_app_permission_count()); } TEST(ExtensionAPIPermissionTest, ComponentOnlyPermissions) { ExtensionPermissionsInfo* info = ExtensionPermissionsInfo::GetInstance(); ExtensionAPIPermissionSet private_perms; - private_perms.insert(ExtensionAPIPermission::kChromeAuthPrivate); private_perms.insert(ExtensionAPIPermission::kChromeosInfoPrivate); private_perms.insert(ExtensionAPIPermission::kFileBrowserPrivate); private_perms.insert(ExtensionAPIPermission::kMediaPlayerPrivate); @@ -200,7 +198,7 @@ TEST(ExtensionAPIPermissionTest, ComponentOnlyPermissions) { info->GetByID(*i)->is_component_only()); } - EXPECT_EQ(5, count); + EXPECT_EQ(4, count); } TEST(ExtensionPermissionSetTest, EffectiveHostPermissions) { @@ -499,7 +497,6 @@ TEST(ExtensionPermissionSetTest, PermissionMessages) { skip.insert(ExtensionAPIPermission::kWebstorePrivate); skip.insert(ExtensionAPIPermission::kFileBrowserPrivate); skip.insert(ExtensionAPIPermission::kMediaPlayerPrivate); - skip.insert(ExtensionAPIPermission::kChromeAuthPrivate); skip.insert(ExtensionAPIPermission::kChromePrivate); skip.insert(ExtensionAPIPermission::kChromeosInfoPrivate); skip.insert(ExtensionAPIPermission::kWebSocketProxyPrivate); diff --git a/chrome/renderer/resources/renderer_extension_bindings.js b/chrome/renderer/resources/renderer_extension_bindings.js index ed78a7b..e55af2d 100644 --- a/chrome/renderer/resources/renderer_extension_bindings.js +++ b/chrome/renderer/resources/renderer_extension_bindings.js @@ -294,7 +294,6 @@ var chrome = chrome || {}; // Entire namespaces. "bookmarks", "browserAction", - "chromeAuthPrivate", "chromePrivate", "chromeosInfoPrivate", "contextMenus", diff --git a/chrome/test/data/extensions/api_test/chrome_auth_private/enable_chrome_connector/cloud_print_success_tests.html b/chrome/test/data/extensions/api_test/chrome_auth_private/enable_chrome_connector/cloud_print_success_tests.html deleted file mode 100644 index bf164c4..0000000 --- a/chrome/test/data/extensions/api_test/chrome_auth_private/enable_chrome_connector/cloud_print_success_tests.html +++ /dev/null @@ -1 +0,0 @@ -<script src="cloud_print_success_tests.js"></script> diff --git a/chrome/test/data/extensions/api_test/chrome_auth_private/enable_chrome_connector/cloud_print_success_tests.js b/chrome/test/data/extensions/api_test/chrome_auth_private/enable_chrome_connector/cloud_print_success_tests.js deleted file mode 100644 index 62f9223..0000000 --- a/chrome/test/data/extensions/api_test/chrome_auth_private/enable_chrome_connector/cloud_print_success_tests.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) 2011 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. - - -var tests = [ - function successfulSetCreds() { - var userEmail = 'foo@gmail.com'; - var robotEmail = 'foorobot@googleusercontent.com'; - var credentials = '1/23546efa54'; - chrome.chromeAuthPrivate.setCloudPrintCredentials( - userEmail, robotEmail, credentials, - chrome.test.callbackPass(function(result) { - // In test mode, we expect the API to reflect the arguments back to - // us appended together. - chrome.test.assertNoLastError(); - chrome.test.assertEq(result, userEmail + robotEmail + credentials); - })); - } -]; - -chrome.test.runTests(tests); diff --git a/chrome/test/data/extensions/api_test/chrome_auth_private/installed_app/background.html b/chrome/test/data/extensions/api_test/chrome_auth_private/installed_app/background.html deleted file mode 100644 index 2cfde44..0000000 --- a/chrome/test/data/extensions/api_test/chrome_auth_private/installed_app/background.html +++ /dev/null @@ -1 +0,0 @@ -<script src="cloud_print_exception.js"></script> diff --git a/chrome/test/data/extensions/api_test/chrome_auth_private/installed_app/cloud_print_exception.js b/chrome/test/data/extensions/api_test/chrome_auth_private/installed_app/cloud_print_exception.js deleted file mode 100644 index 56aef5b..0000000 --- a/chrome/test/data/extensions/api_test/chrome_auth_private/installed_app/cloud_print_exception.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2011 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. - -// This test is invoked from a non-component app. So this call should throw an -// exception when we try and access the chromeAuthPrivate API. -var tests = [ - function exceptionSetCreds() { - var expectedException = - "Error: You do not have permission to use " + - "'chromeAuthPrivate.setCloudPrintCredentials'. Be sure to declare in " + - "your manifest what permissions you need."; - var userEmail = 'foo@gmail.com'; - var robotEmail = 'foorobot@googleusercontent.com'; - var credentials = '1/23546efa54'; - try { - chrome.chromeAuthPrivate.setCloudPrintCredentials( - userEmail, robotEmail, credentials); - } catch (err) { - chrome.test.assertEq(expectedException, err.toString()); - chrome.test.succeed(); - return; - } - chrome.test.fail(); - } -]; - -chrome.test.runTests(tests); diff --git a/chrome/test/data/extensions/api_test/chrome_auth_private/installed_app/manifest.json b/chrome/test/data/extensions/api_test/chrome_auth_private/installed_app/manifest.json deleted file mode 100644 index 6d4da5e..0000000 --- a/chrome/test/data/extensions/api_test/chrome_auth_private/installed_app/manifest.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "Cloud Print Installed App", - "version": "0.1", - "description": "Cloud Print Installed App Test For Failure", - "background_page": "background.html", - "permissions": [ - "chromeAuthPrivate" - ] -} diff --git a/chrome/test/data/extensions/api_test/chrome_auth_private/installed_component_app/background.html b/chrome/test/data/extensions/api_test/chrome_auth_private/installed_component_app/background.html deleted file mode 100644 index 22bb9da..0000000 --- a/chrome/test/data/extensions/api_test/chrome_auth_private/installed_component_app/background.html +++ /dev/null @@ -1 +0,0 @@ -<script src="cloud_print_fail.js"></script> diff --git a/chrome/test/data/extensions/api_test/chrome_auth_private/installed_component_app/cloud_print_fail.js b/chrome/test/data/extensions/api_test/chrome_auth_private/installed_component_app/cloud_print_fail.js deleted file mode 100644 index c5db1102b6..0000000 --- a/chrome/test/data/extensions/api_test/chrome_auth_private/installed_component_app/cloud_print_fail.js +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2011 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. - -// This test is invoked from an installed component app. Since we have an -// explicit URL check in the API, this should fail. -var tests = [ - function failureSetCreds() { - var expectedError = "Cannot call this API from a non-cloudprint URL." - var userEmail = 'foo@gmail.com'; - var robotEmail = 'foorobot@googleusercontent.com'; - var credentials = '1/23546efa54'; - chrome.chromeAuthPrivate.setCloudPrintCredentials( - userEmail, robotEmail, credentials, - chrome.test.callbackFail(expectedError)); - } -]; - -chrome.test.runTests(tests); diff --git a/chrome/test/data/extensions/api_test/chrome_auth_private/installed_component_app/manifest.json b/chrome/test/data/extensions/api_test/chrome_auth_private/installed_component_app/manifest.json deleted file mode 100644 index 63a1f10..0000000 --- a/chrome/test/data/extensions/api_test/chrome_auth_private/installed_component_app/manifest.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCp40PYAXfSDlzCW1f5MDzRW64h0YhgV7MX8Frem0vO1ZAlq/mlUO4KxwkF2AZliFScO4Cc3CYpO6jpHXwz27tUwaN46C/LzYO7u/kb2piOep8gClvZ64EMnDv5PIoIeZlOJhkpnfs/5FbQt5sqT9avXX7YfLCLBJBql0U/V5615wIDAQAB", - "name": "Cloud Print Installed Component App", - "version": "0.1", - "description": "Cloud Print App Test For Failure", - "background_page": "background.html", - "permissions": [ - "chromeAuthPrivate" - ] -} |