Renamed chrome_auth to cloud_print.

No functionality changed except naming.
Server side changes already alive.

BUG=137129
TEST=unittest
Review URL: https://chromiumcodereview.appspot.com/10690177

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149303 0039d316-1c4b-4281-b951-d872f2087c98
parent 1d0f57e1
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/extensions/api/chrome_auth_private/chrome_auth_private_api.h"
#include "chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.h"
#include <string>
#include "base/values.h"
......@@ -19,13 +19,13 @@ bool test_mode = false;
namespace extensions {
SetCloudPrintCredentialsFunction::SetCloudPrintCredentialsFunction() {
CloudPrintSetCredentialsFunction::CloudPrintSetCredentialsFunction() {
}
SetCloudPrintCredentialsFunction::~SetCloudPrintCredentialsFunction() {
CloudPrintSetCredentialsFunction::~CloudPrintSetCredentialsFunction() {
}
bool SetCloudPrintCredentialsFunction::RunImpl() {
bool CloudPrintSetCredentialsFunction::RunImpl() {
std::string user_email;
EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &user_email));
std::string robot_email;
......@@ -46,7 +46,7 @@ bool SetCloudPrintCredentialsFunction::RunImpl() {
}
// static
void SetCloudPrintCredentialsFunction::SetTestMode(bool test_mode_enabled) {
void CloudPrintSetCredentialsFunction::SetTestMode(bool test_mode_enabled) {
test_mode = test_mode_enabled;
}
......
......@@ -2,19 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_EXTENSIONS_API_CHROME_AUTH_PRIVATE_CHROME_AUTH_PRIVATE_API_H_
#define CHROME_BROWSER_EXTENSIONS_API_CHROME_AUTH_PRIVATE_CHROME_AUTH_PRIVATE_API_H_
#ifndef CHROME_BROWSER_EXTENSIONS_API_CLOUD_PRINT_PRIVATE_CLOUD_PRINT_PRIVATE_API_H_
#define CHROME_BROWSER_EXTENSIONS_API_CLOUD_PRINT_PRIVATE_CLOUD_PRINT_PRIVATE_API_H_
#include <string>
#include "chrome/browser/extensions/extension_function.h"
namespace extensions {
class SetCloudPrintCredentialsFunction : public AsyncExtensionFunction {
class CloudPrintSetCredentialsFunction : public AsyncExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION_NAME("chromeAuthPrivate.setCloudPrintCredentials");
DECLARE_EXTENSION_FUNCTION_NAME("cloudPrintPrivate.setCredentials");
SetCloudPrintCredentialsFunction();
CloudPrintSetCredentialsFunction();
// 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
......@@ -22,7 +22,7 @@ class SetCloudPrintCredentialsFunction : public AsyncExtensionFunction {
static void SetTestMode(bool test_mode_enabled);
protected:
virtual ~SetCloudPrintCredentialsFunction();
virtual ~CloudPrintSetCredentialsFunction();
// ExtensionFunction:
virtual bool RunImpl() OVERRIDE;
......@@ -30,4 +30,4 @@ class SetCloudPrintCredentialsFunction : public AsyncExtensionFunction {
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_CHROME_AUTH_PRIVATE_CHROME_AUTH_PRIVATE_API_H_
#endif // CHROME_BROWSER_EXTENSIONS_API_CLOUD_PRINT_PRIVATE_CLOUD_PRINT_PRIVATE_API_H_
......@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "base/stringprintf.h"
#include "chrome/browser/extensions/api/chrome_auth_private/chrome_auth_private_api.h"
#include "chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
......@@ -12,13 +12,13 @@
#include "net/base/mock_host_resolver.h"
// A base class for tests below.
class ExtensionChromeAuthPrivateApiTest : public ExtensionApiTest {
class ExtensionCloudPrintPrivateApiTest : 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");
"cloud_print_private");
}
void SetUpInProcessBrowserTestFixture() OVERRIDE {
......@@ -34,7 +34,7 @@ class ExtensionChromeAuthPrivateApiTest : public ExtensionApiTest {
// flags.
GURL GetTestServerURL(const std::string& path) {
GURL url = test_server()->GetURL(
"files/extensions/api_test/chrome_auth_private/" + path);
"files/extensions/api_test/cloud_print_private/" + path);
// Replace the host with 'www.cloudprintapp.com' so it matches the cloud
// print app's extent.
......@@ -46,15 +46,15 @@ class ExtensionChromeAuthPrivateApiTest : public ExtensionApiTest {
};
#if !defined(OS_CHROMEOS)
IN_PROC_BROWSER_TEST_F(ExtensionChromeAuthPrivateApiTest,
SetCloudPrintCredentialsSuccessHosted) {
IN_PROC_BROWSER_TEST_F(ExtensionCloudPrintPrivateApiTest,
CloudPrintSetCredentialsSuccessHosted) {
// 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.
extensions::SetCloudPrintCredentialsFunction::SetTestMode(true);
extensions::CloudPrintSetCredentialsFunction::SetTestMode(true);
GURL page_url = GetTestServerURL(
"enable_chrome_connector/cloud_print_success_tests.html");
ASSERT_TRUE(RunPageTest(page_url.spec()));
extensions::SetCloudPrintCredentialsFunction::SetTestMode(false);
extensions::CloudPrintSetCredentialsFunction::SetTestMode(false);
}
#endif // !defined(OS_CHROMEOS)
......@@ -9,7 +9,7 @@
#include "chrome/browser/bookmarks/bookmark_manager_extension_api.h"
#include "chrome/browser/extensions/api/app/app_api.h"
#include "chrome/browser/extensions/api/browsing_data/browsing_data_api.h"
#include "chrome/browser/extensions/api/chrome_auth_private/chrome_auth_private_api.h"
#include "chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.h"
#include "chrome/browser/extensions/api/content_settings/content_settings_api.h"
#include "chrome/browser/extensions/api/context_menu/context_menu_api.h"
#include "chrome/browser/extensions/api/cookies/cookies_api.h"
......@@ -443,8 +443,8 @@ void ExtensionFunctionRegistry::ResetFunctions() {
RegisterFunction<GetMinimumFontSizeFunction>();
RegisterFunction<SetMinimumFontSizeFunction>();
// ChromeAuth settings.
RegisterFunction<extensions::SetCloudPrintCredentialsFunction>();
// CloudPrint settings.
RegisterFunction<extensions::CloudPrintSetCredentialsFunction>();
// Experimental App API.
RegisterFunction<extensions::AppNotifyFunction>();
......
......@@ -14,6 +14,6 @@
]
},
"permissions": [
"chromeAuthPrivate"
"cloudPrintPrivate"
]
}
......@@ -549,8 +549,8 @@
'sources': [
'browser/extensions/api/idle/idle_api.cc',
'browser/extensions/api/idle/idle_api.h',
'browser/extensions/api/chrome_auth_private/chrome_auth_private_api.cc',
'browser/extensions/api/chrome_auth_private/chrome_auth_private_api.h',
'browser/extensions/api/cloud_print_private/cloud_print_private_api.cc',
'browser/extensions/api/cloud_print_private/cloud_print_private_api.h',
'browser/extensions/api/page_capture/page_capture_api.cc',
'browser/extensions/api/page_capture/page_capture_api.h',
'browser/extensions/api/debugger/debugger_api.cc',
......
......@@ -2698,7 +2698,7 @@
'browser/extensions/api/app/app_apitest.cc',
'browser/extensions/api/bluetooth/bluetooth_apitest_chromeos.cc',
'browser/extensions/api/browsing_data/browsing_data_test.cc',
'browser/extensions/api/chrome_auth_private/chrome_auth_private_apitest.cc',
'browser/extensions/api/cloud_print_private/cloud_print_private_apitest.cc',
'browser/extensions/api/cookies/cookies_apitest.cc',
'browser/extensions/api/context_menu/context_menu_apitest.cc',
'browser/extensions/api/content_settings/content_settings_apitest.cc',
......
......@@ -43,12 +43,6 @@
"channel": "stable",
"extension_types": ["extension", "packaged_app"]
},
"chromeAuthPrivate": {
"channel": "stable",
"extension_types": ["extension", "packaged_app"],
// CloudPrint
"whitelist": ["mfehgcgbbipciphmccgaenjidiccnmng"]
},
"chromePrivate": {
"channel": "stable",
"extension_types": ["extension", "packaged_app"],
......@@ -75,6 +69,12 @@
"extension", "packaged_app", "hosted_app", "platform_app"
]
},
"cloudPrintPrivate": {
"channel": "stable",
"extension_types": ["extension", "packaged_app"],
// CloudPrint
"whitelist": ["mfehgcgbbipciphmccgaenjidiccnmng"]
},
"commands": {
"channel": "stable",
"extension_types": ["extension", "packaged_app"]
......
......@@ -4,11 +4,11 @@
[
{
"namespace": "chromeAuthPrivate",
"namespace": "cloudPrintPrivate",
"nodoc": "true",
"functions": [
{
"name": "setCloudPrintCredentials",
"name": "setCredentials",
"description": "Sets the login credentials for Cloud Print.",
"type": "function",
"parameters": [
......
......@@ -349,10 +349,10 @@ void ExtensionAPI::InitDefaultConfiguration() {
IDR_EXTENSION_API_JSON_BROWSERACTION));
RegisterSchema("browsingData", ReadFromResource(
IDR_EXTENSION_API_JSON_BROWSINGDATA));
RegisterSchema("chromeAuthPrivate", ReadFromResource(
IDR_EXTENSION_API_JSON_CHROMEAUTHPRIVATE));
RegisterSchema("chromeosInfoPrivate", ReadFromResource(
IDR_EXTENSION_API_JSON_CHROMEOSINFOPRIVATE));
RegisterSchema("cloudPrintPrivate", ReadFromResource(
IDR_EXTENSION_API_JSON_CLOUDPRINTPRIVATE));
RegisterSchema("contentSettings", ReadFromResource(
IDR_EXTENSION_API_JSON_CONTENTSETTINGS));
RegisterSchema("contextMenus", ReadFromResource(
......
......@@ -26,8 +26,8 @@ var MODULE_SCHEMAS = [
'../../api/bookmarks.json',
'../../api/browser_action.json',
'../../api/browsing_data.json',
'../../api/chrome_auth_private.json',
'../../api/chromeos_info_private.json',
'../../api/cloud_print_private.json',
'../../api/content_settings.json',
'../../api/context_menus.json',
'../../api/cookies.json',
......
......@@ -134,7 +134,7 @@ void APIPermission::RegisterAllPermissions(
{ kMediaPlayerPrivate, "mediaPlayerPrivate", kFlagCannotBeOptional },
{ kMetricsPrivate, "metricsPrivate", kFlagCannotBeOptional },
{ kSystemPrivate, "systemPrivate", kFlagCannotBeOptional },
{ kChromeAuthPrivate, "chromeAuthPrivate", kFlagCannotBeOptional },
{ kCloudPrintPrivate, "cloudPrintPrivate", kFlagCannotBeOptional },
{ kInputMethodPrivate, "inputMethodPrivate", kFlagCannotBeOptional },
{ kEchoPrivate, "echoPrivate", kFlagCannotBeOptional },
{ kTerminalPrivate, "terminalPrivate", kFlagCannotBeOptional },
......
......@@ -32,10 +32,10 @@ class APIPermission {
kBookmark,
kBrowserTag,
kBrowsingData,
kChromeAuthPrivate,
kChromeosInfoPrivate,
kClipboardRead,
kClipboardWrite,
kCloudPrintPrivate,
kCommands,
kContentSettings,
kContextMenus,
......
......@@ -587,15 +587,15 @@ TEST(PermissionsTest, PermissionMessages) {
skip.insert(APIPermission::kExperimental);
// These are private.
skip.insert(APIPermission::kChromeAuthPrivate);
skip.insert(APIPermission::kChromeosInfoPrivate);
skip.insert(APIPermission::kCloudPrintPrivate);
skip.insert(APIPermission::kEchoPrivate);
skip.insert(APIPermission::kFileBrowserHandlerInternal);
skip.insert(APIPermission::kFileBrowserPrivate);
skip.insert(APIPermission::kInputMethodPrivate);
skip.insert(APIPermission::kManagedModePrivate);
skip.insert(APIPermission::kMediaPlayerPrivate);
skip.insert(APIPermission::kMetricsPrivate);
skip.insert(APIPermission::kEchoPrivate);
skip.insert(APIPermission::kSystemPrivate);
skip.insert(APIPermission::kTerminalPrivate);
skip.insert(APIPermission::kWallpaperPrivate);
......
......@@ -13,8 +13,8 @@
<include name="IDR_EXTENSION_API_JSON_BOOKMARKS" file="extensions\api\bookmarks.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_BROWSERACTION" file="extensions\api\browser_action.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_BROWSINGDATA" file="extensions\api\browsing_data.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_CHROMEAUTHPRIVATE" file="extensions\api\chrome_auth_private.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_CHROMEOSINFOPRIVATE" file="extensions\api\chromeos_info_private.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_CLOUDPRINTPRIVATE" file="extensions\api\cloud_print_private.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_CONTENTSETTINGS" file="extensions\api\content_settings.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_CONTEXTMENUS" file="extensions\api\context_menus.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_COOKIES" file="extensions\api\cookies.json" type="BINDATA" />
......
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// 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.
......@@ -7,7 +7,7 @@ var tests = [
var userEmail = 'foo@gmail.com';
var robotEmail = 'foorobot@googleusercontent.com';
var credentials = '1/23546efa54';
chrome.chromeAuthPrivate.setCloudPrintCredentials(
chrome.cloudPrintPrivate.setCredentials(
userEmail, robotEmail, credentials,
chrome.test.callbackPass(function(result) {
// In test mode, we expect the API to reflect the arguments back to
......
......@@ -230,11 +230,11 @@ chrome.test.getConfig(function(config) {
// Make sure you can only access the white listed permissions.
function whitelist() {
var error_msg = NOT_WHITE_LISTED_ERROR.replace('*', 'chromeAuthPrivate');
var error_msg = NOT_WHITE_LISTED_ERROR.replace('*', 'cloudPrintPrivate');
chrome.permissions.request(
{permissions: ['chromeAuthPrivate']}, fail(error_msg));
{permissions: ['cloudPrintPrivate']}, fail(error_msg));
chrome.permissions.remove(
{permissions: ['chromeAuthPrivate']}, fail(error_msg));
{permissions: ['cloudPrintPrivate']}, fail(error_msg));
},
function unknownPermission() {
......
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