diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-24 00:15:52 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-24 00:15:52 +0000 |
commit | 5a566b911e935a5cae25da0f2809e9635c07b1d8 (patch) | |
tree | 3c444c9d54f40055af411427e14f763d8cfe7029 /chrome/browser/sync | |
parent | 111bea77d0114189d18c732ef3bb975766461b22 (diff) | |
download | chromium_src-5a566b911e935a5cae25da0f2809e9635c07b1d8.zip chromium_src-5a566b911e935a5cae25da0f2809e9635c07b1d8.tar.gz chromium_src-5a566b911e935a5cae25da0f2809e9635c07b1d8.tar.bz2 |
[Sync] Remove sync/util/oauth.{h,cc} and dependencies
Remove --enable-sync-oauth switch.
Clean up some headers.
BUG=113723
TEST=
Review URL: http://codereview.chromium.org/9455005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123378 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync')
-rw-r--r-- | chrome/browser/sync/internal_api/syncapi_server_connection_manager.cc | 11 | ||||
-rw-r--r-- | chrome/browser/sync/profile_sync_service.cc | 6 | ||||
-rw-r--r-- | chrome/browser/sync/sync_setup_flow.cc | 1 | ||||
-rw-r--r-- | chrome/browser/sync/sync_setup_flow_handler.h | 2 | ||||
-rw-r--r-- | chrome/browser/sync/sync_setup_wizard.cc | 1 | ||||
-rw-r--r-- | chrome/browser/sync/util/DEPS | 5 | ||||
-rw-r--r-- | chrome/browser/sync/util/oauth.cc | 37 | ||||
-rw-r--r-- | chrome/browser/sync/util/oauth.h | 22 |
8 files changed, 7 insertions, 78 deletions
diff --git a/chrome/browser/sync/internal_api/syncapi_server_connection_manager.cc b/chrome/browser/sync/internal_api/syncapi_server_connection_manager.cc index fa11ec9..84a5d01 100644 --- a/chrome/browser/sync/internal_api/syncapi_server_connection_manager.cc +++ b/chrome/browser/sync/internal_api/syncapi_server_connection_manager.cc @@ -1,4 +1,4 @@ -// 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. @@ -6,7 +6,6 @@ #include "chrome/browser/sync/internal_api/http_post_provider_factory.h" #include "chrome/browser/sync/internal_api/http_post_provider_interface.h" -#include "chrome/browser/sync/util/oauth.h" #include "chrome/common/net/http_return.h" #include "net/base/net_errors.h" @@ -42,12 +41,8 @@ bool SyncAPIBridgedConnection::Init(const char* path, http->SetURL(connection_url.c_str(), sync_server_port); if (!auth_token.empty()) { - std::string headers; - if (browser_sync::IsUsingOAuth()) { - headers = "Authorization: OAuth " + auth_token; - } else { - headers = "Authorization: GoogleLogin auth=" + auth_token; - } + const std::string& headers = + "Authorization: GoogleLogin auth=" + auth_token; http->SetExtraRequestHeaders(headers.c_str()); } diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc index 71d3881..3327492 100644 --- a/chrome/browser/sync/profile_sync_service.cc +++ b/chrome/browser/sync/profile_sync_service.cc @@ -24,7 +24,6 @@ #include "chrome/browser/about_flags.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/net/chrome_cookie_notification_details.h" - #include "chrome/browser/profiles/profile.h" #include "chrome/browser/signin/signin_manager.h" #include "chrome/browser/signin/token_service.h" @@ -43,7 +42,6 @@ #include "chrome/browser/sync/profile_sync_components_factory_impl.h" #include "chrome/browser/sync/sync_global_error.h" #include "chrome/browser/sync/util/cryptographer.h" -#include "chrome/browser/sync/util/oauth.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_window.h" @@ -176,7 +174,7 @@ bool ProfileSyncService::AreCredentialsAvailable( return false; // TODO(chron): Verify CrOS unit test behavior. - if (!token_service->HasTokenForService(browser_sync::SyncServiceName())) + if (!token_service->HasTokenForService(GaiaConstants::kSyncService)) return false; return !check_oauth_login_token || token_service->HasOAuthLoginToken(); } @@ -309,7 +307,7 @@ SyncCredentials ProfileSyncService::GetCredentials() { DCHECK(!credentials.email.empty()); TokenService* service = profile_->GetTokenService(); credentials.sync_token = service->GetTokenForService( - browser_sync::SyncServiceName()); + GaiaConstants::kSyncService); return credentials; } diff --git a/chrome/browser/sync/sync_setup_flow.cc b/chrome/browser/sync/sync_setup_flow.cc index 3b11c1a..40356bc 100644 --- a/chrome/browser/sync/sync_setup_flow.cc +++ b/chrome/browser/sync/sync_setup_flow.cc @@ -20,7 +20,6 @@ #include "chrome/browser/sync/sync_setup_flow_handler.h" #include "chrome/browser/sync/syncable/model_type.h" #include "chrome/browser/sync/user_selectable_sync_type.h" -#include "chrome/browser/sync/util/oauth.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/net/gaia/gaia_constants.h" diff --git a/chrome/browser/sync/sync_setup_flow_handler.h b/chrome/browser/sync/sync_setup_flow_handler.h index 6a8ef2c..8c92311 100644 --- a/chrome/browser/sync/sync_setup_flow_handler.h +++ b/chrome/browser/sync/sync_setup_flow_handler.h @@ -8,6 +8,8 @@ #include <string> +#include "base/string16.h" + class SyncSetupFlow; namespace base { diff --git a/chrome/browser/sync/sync_setup_wizard.cc b/chrome/browser/sync/sync_setup_wizard.cc index 97b501a..02ddd75 100644 --- a/chrome/browser/sync/sync_setup_wizard.cc +++ b/chrome/browser/sync/sync_setup_wizard.cc @@ -12,7 +12,6 @@ #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sync/sync_setup_flow.h" -#include "chrome/browser/sync/util/oauth.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" diff --git a/chrome/browser/sync/util/DEPS b/chrome/browser/sync/util/DEPS index b8f365f..cb1b125 100644 --- a/chrome/browser/sync/util/DEPS +++ b/chrome/browser/sync/util/DEPS @@ -11,9 +11,4 @@ include_rules = [ # unittests need this for mac osx keychain overriding "+chrome/browser/password_manager/encryptor.h", - - "+chrome/common/chrome_switches.h", - "+chrome/common/net/gaia/gaia_constants.h", - "+chrome/common/random.h", ] - diff --git a/chrome/browser/sync/util/oauth.cc b/chrome/browser/sync/util/oauth.cc deleted file mode 100644 index ddd3dec..0000000 --- a/chrome/browser/sync/util/oauth.cc +++ /dev/null @@ -1,37 +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/sync/util/oauth.h" - -#include "base/command_line.h" -#include "chrome/common/chrome_switches.h" -#include "chrome/common/net/gaia/gaia_constants.h" - -namespace browser_sync { - -static bool has_local_override = false; -static bool local_override = false; - -// TODO(rickcam): Bug(92948): Remove IsUsingOAuth post-ClientLogin -bool IsUsingOAuth() { - if (has_local_override) - return local_override; - return CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableSyncOAuth); -} - -// TODO(rickcam): Bug(92948): Remove SyncServiceName post-ClientLogin -const char* SyncServiceName() { - return IsUsingOAuth() ? - GaiaConstants::kSyncServiceOAuth : - GaiaConstants::kSyncService; -} - -// TODO(rickcam): Bug(92948): Remove SetIsUsingOAuthForTest post-ClientLogin -void SetIsUsingOAuthForTest(bool is_using_oauth) { - has_local_override = true; - local_override = is_using_oauth; -} - -} // namespace browser_sync diff --git a/chrome/browser/sync/util/oauth.h b/chrome/browser/sync/util/oauth.h deleted file mode 100644 index 43e2613..0000000 --- a/chrome/browser/sync/util/oauth.h +++ /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. - -#ifndef CHROME_BROWSER_SYNC_UTIL_OAUTH_H_ -#define CHROME_BROWSER_SYNC_UTIL_OAUTH_H_ -#pragma once - -namespace browser_sync { - -// TODO(rickcam): Bug(92948): Remove IsUsingOAuth after ClientLogin is gone -bool IsUsingOAuth(); - -// TODO(rickcam): Bug(92948): Remove SyncServiceName post-ClientLogin -const char* SyncServiceName(); - -// TODO(rickcam): Bug(92948): Remove SetIsUsingOAuthForTest post-ClientLogin -void SetIsUsingOAuthForTest(bool is_using_oauth); - -} // namespace browser_sync - -#endif // CHROME_BROWSER_SYNC_UTIL_OAUTH_H_ |