Commit 9795d0c0 authored by atwilson@chromium.org's avatar atwilson@chromium.org

Remove BrowserSignin, as it's not used anywhere.

BUG=none
TEST=none


Review URL: http://codereview.chromium.org/7748038

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98690 0039d316-1c4b-4281-b951-d872f2087c98
parent ad725891
...@@ -95,7 +95,6 @@ ...@@ -95,7 +95,6 @@
<include name="IDR_SAFE_BROWSING_PHISHING_BLOCK" file="resources\safe_browsing_phishing_block.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_SAFE_BROWSING_PHISHING_BLOCK" file="resources\safe_browsing_phishing_block.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_SESSIONS_HTML" file="resources\sessions.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" /> <include name="IDR_SESSIONS_HTML" file="resources\sessions.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
<include name="IDR_SESSIONS_JS" file="resources\sessions.js" flattenhtml="true" type="BINDATA" /> <include name="IDR_SESSIONS_JS" file="resources\sessions.js" flattenhtml="true" type="BINDATA" />
<include name="IDR_SIGNIN_HTML" file="resources\browser_signin.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_SSL_ERROR_HTML" file="resources\ssl_error.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_SSL_ERROR_HTML" file="resources\ssl_error.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_SSL_ROAD_BLOCK_HTML" file="resources\ssl_roadblock.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_SSL_ROAD_BLOCK_HTML" file="resources\ssl_roadblock.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_SYNC_CONFIGURE_HTML" file="sync\resources\configure.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_SYNC_CONFIGURE_HTML" file="sync\resources\configure.html" flattenhtml="true" type="BINDATA" />
......
This diff is collapsed.
// 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_BROWSER_SIGNIN_H_
#define CHROME_BROWSER_BROWSER_SIGNIN_H_
#pragma once
#include <string>
#include "base/memory/scoped_ptr.h"
#include "chrome/common/net/gaia/google_service_auth_error.h"
#include "content/common/notification_observer.h"
#include "content/common/notification_registrar.h"
class BrowserSigninHtml;
class Profile;
class ProfileSyncService;
class TabContents;
// The BrowserSignin class provides a login screen which allows the
// user to signin to the browser. Currently the signin is coordinated
// through the Chrome Sync logic.
//
// TODO(johnnyg): Separate this from the sync logic and make it the
// sole co-ordinator of browser signin.
//
// This class should only be accessed on the UI thread.
class BrowserSignin : public NotificationObserver {
public:
explicit BrowserSignin(Profile* profile);
virtual ~BrowserSignin();
// The delegate class is invoked on success and failure.
class SigninDelegate {
public:
virtual ~SigninDelegate() {}
// The login was successful.
virtual void OnLoginSuccess() = 0;
// The login failed.
virtual void OnLoginFailure(const GoogleServiceAuthError& error) = 0;
};
// Request that the user signin, modal to TabContents provided.
// If a user is already signed in, this will show a login dialog where
// the username is not editable.
//
// A custom HTML string can be provided that will be displayed next
// to the signin dialog.
//
// Only one sign-in can be in process at a time; if there is one in
// progress already it will be canceled in favor of this one.
//
// The delegate will eventually be called with OnLoginSuccess() or
// OnLoginFailure(), but never both. virtual for test override.
virtual void RequestSignin(TabContents* tab_contents,
const string16& suggested_email,
const string16& login_message,
SigninDelegate* delegate);
// Returns the username of the user currently signed in. If no
// user is signed in, returns the empty string. virtual for test
// override.
virtual std::string GetSignedInUsername() const;
// NotificationObserver implementation.
virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details);
ProfileSyncService* GetProfileSyncService() const;
// Close the dialog. Delegate's OnLoginFailure method will be called.
void Cancel();
private:
// Create the HTML Dialog content.
BrowserSigninHtml* CreateHtmlDialogUI();
// When the dialog is closed.
void OnLoginFinished();
// Turn auth notifications on.
void RegisterAuthNotifications();
// Turn auth notifications off.
void UnregisterAuthNotifications();
// Show the dialog Tab-Modal.
void ShowSigninTabModal(TabContents* tab_contents);
// Non-owned pointer to the profile (which owns this object).
Profile* profile_;
// Suggested email for the current login prompt.
string16 suggested_email_;
// Current login message.
string16 login_message_;
// Delegate for the current sign in request.
SigninDelegate* delegate_;
// Current HTML Dialog information. Pointer is owned by the WebUI it will be
// attached to.
BrowserSigninHtml* html_dialog_ui_delegate_;
NotificationRegistrar registrar_;
DISALLOW_COPY_AND_ASSIGN(BrowserSignin);
};
#endif // CHROME_BROWSER_BROWSER_SIGNIN_H_
...@@ -344,7 +344,6 @@ void FactoryRegistry::ResetFunctions() { ...@@ -344,7 +344,6 @@ void FactoryRegistry::ResetFunctions() {
RegisterFunction<GetBrowserLoginFunction>(); RegisterFunction<GetBrowserLoginFunction>();
RegisterFunction<GetStoreLoginFunction>(); RegisterFunction<GetStoreLoginFunction>();
RegisterFunction<SetStoreLoginFunction>(); RegisterFunction<SetStoreLoginFunction>();
RegisterFunction<PromptBrowserLoginFunction>();
RegisterFunction<BeginInstallFunction>(); RegisterFunction<BeginInstallFunction>();
RegisterFunction<BeginInstallWithManifestFunction>(); RegisterFunction<BeginInstallWithManifestFunction>();
RegisterFunction<CompleteInstallFunction>(); RegisterFunction<CompleteInstallFunction>();
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "chrome/browser/sync/profile_sync_service.h" #include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/extensions/extension_constants.h" #include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension_error_utils.h" #include "chrome/common/extensions/extension_error_utils.h"
#include "chrome/common/extensions/extension_l10n_util.h" #include "chrome/common/extensions/extension_l10n_util.h"
...@@ -54,7 +55,6 @@ const char kUserGestureRequiredError[] = ...@@ -54,7 +55,6 @@ const char kUserGestureRequiredError[] =
"This function must be called during a user gesture"; "This function must be called during a user gesture";
ProfileSyncService* test_sync_service = NULL; ProfileSyncService* test_sync_service = NULL;
BrowserSignin* test_signin = NULL;
bool ignore_user_gesture_for_tests = false; bool ignore_user_gesture_for_tests = false;
// A flag used for BeginInstallWithManifest::SetAutoConfirmForTests. // A flag used for BeginInstallWithManifest::SetAutoConfirmForTests.
...@@ -74,13 +74,6 @@ ProfileSyncService* GetSyncService(Profile* profile) { ...@@ -74,13 +74,6 @@ ProfileSyncService* GetSyncService(Profile* profile) {
return profile->GetProfileSyncService(); return profile->GetProfileSyncService();
} }
BrowserSignin* GetBrowserSignin(Profile* profile) {
if (test_signin)
return test_signin;
else
return profile->GetBrowserSignin();
}
bool IsWebStoreURL(Profile* profile, const GURL& url) { bool IsWebStoreURL(Profile* profile, const GURL& url) {
ExtensionService* service = profile->GetExtensionService(); ExtensionService* service = profile->GetExtensionService();
const Extension* store = service->GetWebStoreApp(); const Extension* store = service->GetWebStoreApp();
...@@ -95,7 +88,8 @@ bool IsWebStoreURL(Profile* profile, const GURL& url) { ...@@ -95,7 +88,8 @@ bool IsWebStoreURL(Profile* profile, const GURL& url) {
// the appropriate values in the passed-in |profile|. // the appropriate values in the passed-in |profile|.
DictionaryValue* CreateLoginResult(Profile* profile) { DictionaryValue* CreateLoginResult(Profile* profile) {
DictionaryValue* dictionary = new DictionaryValue(); DictionaryValue* dictionary = new DictionaryValue();
std::string username = GetBrowserSignin(profile)->GetSignedInUsername(); std::string username = profile->GetPrefs()->GetString(
prefs::kGoogleServicesUsername);
dictionary->SetString(kLoginKey, username); dictionary->SetString(kLoginKey, username);
if (!username.empty()) { if (!username.empty()) {
CommandLine* cmdline = CommandLine::ForCurrentProcess(); CommandLine* cmdline = CommandLine::ForCurrentProcess();
...@@ -118,11 +112,6 @@ void WebstorePrivateApi::SetTestingProfileSyncService( ...@@ -118,11 +112,6 @@ void WebstorePrivateApi::SetTestingProfileSyncService(
test_sync_service = service; test_sync_service = service;
} }
// static
void WebstorePrivateApi::SetTestingBrowserSignin(BrowserSignin* signin) {
test_signin = signin;
}
// static // static
void BeginInstallFunction::SetIgnoreUserGestureForTests(bool ignore) { void BeginInstallFunction::SetIgnoreUserGestureForTests(bool ignore) {
ignore_user_gesture_for_tests = ignore; ignore_user_gesture_for_tests = ignore;
...@@ -460,119 +449,3 @@ bool SetStoreLoginFunction::RunImpl() { ...@@ -460,119 +449,3 @@ bool SetStoreLoginFunction::RunImpl() {
prefs->SetWebStoreLogin(login); prefs->SetWebStoreLogin(login);
return true; return true;
} }
PromptBrowserLoginFunction::PromptBrowserLoginFunction()
: waiting_for_token_(false) {}
PromptBrowserLoginFunction::~PromptBrowserLoginFunction() {
}
bool PromptBrowserLoginFunction::RunImpl() {
if (!IsWebStoreURL(profile_, source_url()))
return false;
std::string preferred_email;
if (args_->GetSize() > 0) {
EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &preferred_email));
}
Profile* profile = profile_->GetOriginalProfile();
// Login can currently only be invoked tab-modal. Since this is
// coming from the webstore, we should always have a tab, but check
// just in case.
TabContents* tab = dispatcher()->delegate()->GetAssociatedTabContents();
if (!tab)
return false;
// We return the result asynchronously, so we addref to keep ourself alive.
// Matched with a Release in OnLoginSuccess() and OnLoginFailure().
AddRef();
// Start listening for notifications about the token.
TokenService* token_service = profile->GetTokenService();
registrar_.Add(this,
chrome::NOTIFICATION_TOKEN_AVAILABLE,
Source<TokenService>(token_service));
registrar_.Add(this,
chrome::NOTIFICATION_TOKEN_REQUEST_FAILED,
Source<TokenService>(token_service));
GetBrowserSignin(profile)->RequestSignin(tab,
ASCIIToUTF16(preferred_email),
GetLoginMessage(),
this);
// The response will be sent asynchronously in OnLoginSuccess/OnLoginFailure.
return true;
}
string16 PromptBrowserLoginFunction::GetLoginMessage() {
using l10n_util::GetStringUTF16;
using l10n_util::GetStringFUTF16;
// TODO(johnnyg): This would be cleaner as an HTML template.
// http://crbug.com/60216
string16 message;
message = ASCIIToUTF16("<p>")
+ GetStringUTF16(IDS_WEB_STORE_LOGIN_INTRODUCTION_1)
+ ASCIIToUTF16("</p>");
message = message + ASCIIToUTF16("<p>")
+ GetStringFUTF16(IDS_WEB_STORE_LOGIN_INTRODUCTION_2,
GetStringUTF16(IDS_PRODUCT_NAME))
+ ASCIIToUTF16("</p>");
return message;
}
void PromptBrowserLoginFunction::OnLoginSuccess() {
// Ensure that apps are synced.
// - If the user has already setup sync, we add Apps to the current types.
// - If not, we create a new set which is just Apps.
ProfileSyncService* service = GetSyncService(profile_->GetOriginalProfile());
syncable::ModelTypeSet types;
if (service->HasSyncSetupCompleted())
service->GetPreferredDataTypes(&types);
types.insert(syncable::APPS);
service->ChangePreferredDataTypes(types);
service->SetSyncSetupCompleted();
// We'll finish up in Observe() when the token is ready.
waiting_for_token_ = true;
}
void PromptBrowserLoginFunction::OnLoginFailure(
const GoogleServiceAuthError& error) {
SendResponse(false);
// Matches the AddRef in RunImpl().
Release();
}
void PromptBrowserLoginFunction::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
// Make sure this notification is for the service we are interested in.
std::string service;
if (type == chrome::NOTIFICATION_TOKEN_AVAILABLE) {
TokenService::TokenAvailableDetails* available =
Details<TokenService::TokenAvailableDetails>(details).ptr();
service = available->service();
} else if (type == chrome::NOTIFICATION_TOKEN_REQUEST_FAILED) {
TokenService::TokenRequestFailedDetails* failed =
Details<TokenService::TokenRequestFailedDetails>(details).ptr();
service = failed->service();
} else {
NOTREACHED();
}
if (service != GaiaConstants::kGaiaService) {
return;
}
DCHECK(waiting_for_token_);
result_.reset(CreateLoginResult(profile_->GetOriginalProfile()));
SendResponse(true);
// Matches the AddRef in RunImpl().
Release();
}
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include <string> #include <string>
#include "chrome/browser/browser_signin.h"
#include "chrome/browser/extensions/extension_function.h" #include "chrome/browser/extensions/extension_function.h"
#include "chrome/browser/extensions/extension_install_ui.h" #include "chrome/browser/extensions/extension_install_ui.h"
#include "chrome/browser/extensions/webstore_install_helper.h" #include "chrome/browser/extensions/webstore_install_helper.h"
...@@ -23,10 +22,6 @@ class WebstorePrivateApi { ...@@ -23,10 +22,6 @@ class WebstorePrivateApi {
// Allows you to set the ProfileSyncService the function will use for // Allows you to set the ProfileSyncService the function will use for
// testing purposes. // testing purposes.
static void SetTestingProfileSyncService(ProfileSyncService* service); static void SetTestingProfileSyncService(ProfileSyncService* service);
// Allows you to set the BrowserSignin the function will use for
// testing purposes.
static void SetTestingBrowserSignin(BrowserSignin* signin);
}; };
// TODO(asargent): this is being deprecated in favor of // TODO(asargent): this is being deprecated in favor of
...@@ -146,35 +141,4 @@ class SetStoreLoginFunction : public SyncExtensionFunction { ...@@ -146,35 +141,4 @@ class SetStoreLoginFunction : public SyncExtensionFunction {
DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.setStoreLogin"); DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.setStoreLogin");
}; };
class PromptBrowserLoginFunction : public AsyncExtensionFunction,
public NotificationObserver,
public BrowserSignin::SigninDelegate {
public:
PromptBrowserLoginFunction();
// Implements BrowserSignin::SigninDelegate interface.
virtual void OnLoginSuccess();
virtual void OnLoginFailure(const GoogleServiceAuthError& error);
// Implements the NotificationObserver interface.
virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details);
protected:
virtual ~PromptBrowserLoginFunction();
virtual bool RunImpl();
private:
// Creates the message for signing in.
virtual string16 GetLoginMessage();
// Are we waiting for a token available notification?
bool waiting_for_token_;
// Used for listening for TokenService notifications.
NotificationRegistrar registrar_;
DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.promptBrowserLogin");
};
#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_ #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_
// 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/string_number_conversions.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_signin.h"
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/extensions/extension_test_message_listener.h"
#include "chrome/browser/extensions/extension_webstore_private_api.h"
#include "chrome/browser/net/gaia/token_service.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/signin_manager.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/net/gaia/gaia_constants.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "googleurl/src/gurl.h"
#include "net/base/mock_host_resolver.h"
using chrome::kHttpScheme;
using chrome::kStandardSchemeSeparator;
namespace {
const char kTestUrlHostname[] = "www.example.com";
} // namespace
// A fake version of ProfileSyncService used for testing.
class FakeProfileSyncService : public ProfileSyncService {
public:
FakeProfileSyncService()
: ProfileSyncService(NULL, NULL, new SigninManager(), ""),
setup_(false) {
}
virtual ~FakeProfileSyncService() {}
// Overrides of virtual methods in ProfileSyncService.
virtual bool HasSyncSetupCompleted() const {
return setup_;
}
virtual void ChangePreferredDataTypes(const syncable::ModelTypeSet& types) {
types_ = types;
}
virtual void GetPreferredDataTypes(syncable::ModelTypeSet* types) const {
*types = types_;
}
virtual void SetSyncSetupCompleted() {
setup_ = true;
}
private:
bool setup_;
syncable::ModelTypeSet types_;
};
class FakeBrowserSignin : public BrowserSignin {
public:
// The |username_after_login| parameter determines what this fake
// BrowserSignin will set the username to when ShowLoginDialog is called.
FakeBrowserSignin(bool should_succeed,
const std::string& initial_username,
const std::string& username_after_login)
: BrowserSignin(NULL),
should_succeed_(should_succeed),
username_(initial_username),
username_after_login_(username_after_login) {
}
virtual ~FakeBrowserSignin() {}
virtual std::string GetSignedInUsername() const {
return username_;
}
virtual void RequestSignin(TabContents* tab_contents,
const string16& preferred_email,
const string16& message,
SigninDelegate* delegate) {
if (should_succeed_) {
// Simulate valid login.
username_ = username_after_login_;
delegate->OnLoginSuccess();
// Fake a token available notification.
Profile* profile = Profile::FromBrowserContext(
tab_contents->browser_context())->GetOriginalProfile();
TokenService* token_service = profile->GetTokenService();
token_service->IssueAuthTokenForTest(GaiaConstants::kGaiaService,
"new_token");
} else {
delegate->OnLoginFailure(GoogleServiceAuthError(
GoogleServiceAuthError::REQUEST_CANCELED));
}
}
private:
bool should_succeed_;
std::string username_;
std::string username_after_login_;
};
class ExtensionWebstorePrivateBrowserTest : public ExtensionBrowserTest {
public:
ExtensionWebstorePrivateBrowserTest() {
test_url_base_ = std::string() + kHttpScheme + kStandardSchemeSeparator +
kTestUrlHostname;
}
void SetUpCommandLine(CommandLine* command_line) {
ExtensionBrowserTest::SetUpCommandLine(command_line);
command_line->AppendSwitchASCII(switches::kAppsGalleryURL, test_url_base_);
}
// This generates a regular test server url pointing to a test file at
// |relative_path|, but replaces the hostname with kTestUrlHostname so that
// we get the webstore private APIs injected (this happens because of the
// command line switch we added in SetupCommandLine).
GURL GetUrl(const std::string& relative_path) {
GURL base_url = test_server()->GetURL(
"files/extensions/webstore_private/" + relative_path);
GURL::Replacements replacements;
std::string replacement_host = std::string(kTestUrlHostname);
replacements.SetHostStr(replacement_host);
return base_url.ReplaceComponents(replacements);
}
void RunLoginTestImpl(bool incognito,
const std::string& relative_path,
const std::string& initial_login,
bool login_succeeds,
const std::string& login_result) {
// Clear the token service so previous tests don't affect things.
TokenService* token_service = browser()->profile()->GetTokenService();
token_service->ResetCredentialsInMemory();
if (!initial_login.empty()) {
// Initialize the token service with an existing token.
token_service->IssueAuthTokenForTest(GaiaConstants::kGaiaService,
"existing_token");
}
FakeProfileSyncService sync_service;
FakeBrowserSignin signin(login_succeeds, initial_login, login_result);
WebstorePrivateApi::SetTestingProfileSyncService(&sync_service);
WebstorePrivateApi::SetTestingBrowserSignin(&signin);
ExtensionTestMessageListener listener("success", false);
GURL url = GetUrl(relative_path);
if (incognito) {
ui_test_utils::OpenURLOffTheRecord(browser()->profile(), url);
} else {
ui_test_utils::NavigateToURL(browser(), url);
}
EXPECT_TRUE(listener.WaitUntilSatisfied());
WebstorePrivateApi::SetTestingBrowserSignin(NULL);
WebstorePrivateApi::SetTestingProfileSyncService(NULL);
}
void RunLoginTest(const std::string& relative_path,
const std::string& initial_login,
bool login_succeeds,
const std::string& login_result) {
RunLoginTestImpl(true,
relative_path,
initial_login,
login_succeeds,
login_result);
RunLoginTestImpl(false,
relative_path,
initial_login,
login_succeeds,
login_result);
}
protected:
std::string test_url_base_;
};
// TODO(asargent) I've added some extra logging to this test since we've seen a
// few failures on the bots lately. See crbug.com/91753 for details.
IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateBrowserTest, BrowserLogin) {
LOG(INFO) << "Adding rule to host resolver";
host_resolver()->AddRule(kTestUrlHostname, "127.0.0.1");
LOG(INFO) << "Starting test server";
ASSERT_TRUE(test_server()->Start());
LOG(INFO) << "expect_nonempty.html";
RunLoginTest("browser_login/expect_nonempty.html",
"foo@bar.com", false, "");
LOG(INFO) << "prompt_no_preferred.html";
RunLoginTest("browser_login/prompt_no_preferred.html", "", true, "");
LOG(INFO) << "prompt_preferred.html";
RunLoginTest("browser_login/prompt_preferred.html", "", true, "foo@bar.com");
LOG(INFO) << "prompt_login_fails.html";
RunLoginTest("browser_login/prompt_login_fails.html",
"", false, "foo@bar.com");
}
...@@ -594,10 +594,6 @@ class OffTheRecordProfileImpl : public Profile, ...@@ -594,10 +594,6 @@ class OffTheRecordProfileImpl : public Profile,
return NULL; return NULL;
} }
virtual BrowserSignin* GetBrowserSignin() {
return profile_->GetBrowserSignin();
}
virtual bool IsSameProfile(Profile* profile) { virtual bool IsSameProfile(Profile* profile) {
return (profile == this) || (profile == profile_); return (profile == this) || (profile == profile_);
} }
......
...@@ -54,7 +54,6 @@ class SpeechRecognizer; ...@@ -54,7 +54,6 @@ class SpeechRecognizer;
class AutocompleteClassifier; class AutocompleteClassifier;
class BookmarkModel; class BookmarkModel;
class BrowserSignin;
class ChromeAppCacheService; class ChromeAppCacheService;
class ChromeURLDataManager; class ChromeURLDataManager;
class Extension; class Extension;
...@@ -358,9 +357,6 @@ class Profile : public content::BrowserContext { ...@@ -358,9 +357,6 @@ class Profile : public content::BrowserContext {
// by the profile. // by the profile.
virtual fileapi::FileSystemContext* GetFileSystemContext() = 0; virtual fileapi::FileSystemContext* GetFileSystemContext() = 0;
// Returns the BrowserSignin object assigned to this profile.
virtual BrowserSignin* GetBrowserSignin() = 0;
// Returns the request context used for extension-related requests. This // Returns the request context used for extension-related requests. This
// is only used for a separate cookie store currently. // is only used for a separate cookie store currently.
virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0; virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0;
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include "chrome/browser/background/background_mode_manager.h" #include "chrome/browser/background/background_mode_manager.h"
#include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_signin.h"
#include "chrome/browser/browsing_data_remover.h" #include "chrome/browser/browsing_data_remover.h"
#include "chrome/browser/content_settings/host_content_settings_map.h" #include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry.h" #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
...@@ -1555,13 +1554,6 @@ ProfileSyncService* ProfileImpl::GetProfileSyncService( ...@@ -1555,13 +1554,6 @@ ProfileSyncService* ProfileImpl::GetProfileSyncService(
return sync_service_.get(); return sync_service_.get();
} }
BrowserSignin* ProfileImpl::GetBrowserSignin() {
if (!browser_signin_.get()) {
browser_signin_.reset(new BrowserSignin(this));
}
return browser_signin_.get();
}
void ProfileImpl::InitSyncService(const std::string& cros_user) { void ProfileImpl::InitSyncService(const std::string& cros_user) {
profile_sync_factory_.reset( profile_sync_factory_.reset(
new ProfileSyncFactoryImpl(this, CommandLine::ForCurrentProcess())); new ProfileSyncFactoryImpl(this, CommandLine::ForCurrentProcess()));
......
...@@ -122,7 +122,6 @@ class ProfileImpl : public Profile, ...@@ -122,7 +122,6 @@ class ProfileImpl : public Profile,
virtual ChromeBlobStorageContext* GetBlobStorageContext(); virtual ChromeBlobStorageContext* GetBlobStorageContext();
virtual ExtensionInfoMap* GetExtensionInfoMap(); virtual ExtensionInfoMap* GetExtensionInfoMap();
virtual PromoCounter* GetInstantPromoCounter(); virtual PromoCounter* GetInstantPromoCounter();
virtual BrowserSignin* GetBrowserSignin();
virtual ChromeURLDataManager* GetChromeURLDataManager(); virtual ChromeURLDataManager* GetChromeURLDataManager();
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
...@@ -239,7 +238,6 @@ class ProfileImpl : public Profile, ...@@ -239,7 +238,6 @@ class ProfileImpl : public Profile,
scoped_refptr<WebKitContext> webkit_context_; scoped_refptr<WebKitContext> webkit_context_;
scoped_refptr<PersonalDataManager> personal_data_manager_; scoped_refptr<PersonalDataManager> personal_data_manager_;
scoped_refptr<fileapi::FileSystemContext> file_system_context_; scoped_refptr<fileapi::FileSystemContext> file_system_context_;
scoped_ptr<BrowserSignin> browser_signin_;
scoped_refptr<quota::QuotaManager> quota_manager_; scoped_refptr<quota::QuotaManager> quota_manager_;
bool history_service_created_; bool history_service_created_;
bool favicon_service_created_; bool favicon_service_created_;
......
<html>
<style>
body {
margin: 0;
font-family: arial,sans-serif;
}
#message {
position: absolute;
left: 10px;
width: 45%;
}
#login {
position: absolute;
left: 50%;
}
#message h1 {
font-size: medium;
}
#message p {
font-size: smaller;
}
</style>
<script>
function initmessage() {
document.getElementById('message').innerHTML = chrome.dialogArguments;
}
function init() {
chrome.send('SigninInit');
initmessage();
}
</script>
<body onload="init();">
<div id="message"></div>
<iframe id="login" frameborder="0" width="50%" scrolling="no" height="100%"
src="chrome://syncresources/gaialogin" tabindex="-1"></iframe>
</body>
</html>
...@@ -326,15 +326,6 @@ void PersonalOptionsHandler::OnStateChanged() { ...@@ -326,15 +326,6 @@ void PersonalOptionsHandler::OnStateChanged() {
SendProfilesInfo(); SendProfilesInfo();
} }
void PersonalOptionsHandler::OnLoginSuccess() {
OnStateChanged();
}
void PersonalOptionsHandler::OnLoginFailure(
const GoogleServiceAuthError& error) {
OnStateChanged();
}
void PersonalOptionsHandler::ObserveThemeChanged() { void PersonalOptionsHandler::ObserveThemeChanged() {
Profile* profile = Profile::FromWebUI(web_ui_); Profile* profile = Profile::FromWebUI(web_ui_);
#if defined(TOOLKIT_GTK) #if defined(TOOLKIT_GTK)
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#pragma once #pragma once
#include "base/basictypes.h" #include "base/basictypes.h"
#include "chrome/browser/browser_signin.h"
#include "chrome/browser/sync/profile_sync_service.h" #include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/ui/webui/options/options_ui.h" #include "chrome/browser/ui/webui/options/options_ui.h"
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
...@@ -16,8 +15,7 @@ ...@@ -16,8 +15,7 @@
// Chrome personal options page UI handler. // Chrome personal options page UI handler.
class PersonalOptionsHandler : public OptionsPageUIHandler, class PersonalOptionsHandler : public OptionsPageUIHandler,
public ProfileSyncServiceObserver, public ProfileSyncServiceObserver {
public BrowserSignin::SigninDelegate {
public: public:
PersonalOptionsHandler(); PersonalOptionsHandler();
virtual ~PersonalOptionsHandler(); virtual ~PersonalOptionsHandler();
...@@ -37,10 +35,6 @@ class PersonalOptionsHandler : public OptionsPageUIHandler, ...@@ -37,10 +35,6 @@ class PersonalOptionsHandler : public OptionsPageUIHandler,
// ProfileSyncServiceObserver implementation. // ProfileSyncServiceObserver implementation.
virtual void OnStateChanged(); virtual void OnStateChanged();
// BrowserSignin::SigninDelegate implementation.
virtual void OnLoginSuccess();
virtual void OnLoginFailure(const GoogleServiceAuthError& error);
private: private:
void ObserveThemeChanged(); void ObserveThemeChanged();
void ThemesReset(const ListValue* args); void ThemesReset(const ListValue* args);
......
...@@ -301,8 +301,6 @@ ...@@ -301,8 +301,6 @@
'browser/browser_process_sub_thread.h', 'browser/browser_process_sub_thread.h',
'browser/browser_shutdown.cc', 'browser/browser_shutdown.cc',
'browser/browser_shutdown.h', 'browser/browser_shutdown.h',
'browser/browser_signin.cc',
'browser/browser_signin.h',
'browser/browser_trial.cc', 'browser/browser_trial.cc',
'browser/browser_trial.h', 'browser/browser_trial.h',
'browser/browser_util_win.cc', 'browser/browser_util_win.cc',
......
...@@ -2522,7 +2522,6 @@ ...@@ -2522,7 +2522,6 @@
'browser/extensions/extension_webrequest_apitest.cc', 'browser/extensions/extension_webrequest_apitest.cc',
'browser/extensions/extension_websocket_apitest.cc', 'browser/extensions/extension_websocket_apitest.cc',
'browser/extensions/extension_webstore_private_apitest.cc', 'browser/extensions/extension_webstore_private_apitest.cc',
'browser/extensions/extension_webstore_private_browsertest.cc',
'browser/extensions/isolated_app_apitest.cc', 'browser/extensions/isolated_app_apitest.cc',
'browser/extensions/notifications_apitest.cc', 'browser/extensions/notifications_apitest.cc',
'browser/extensions/page_action_apitest.cc', 'browser/extensions/page_action_apitest.cc',
......
...@@ -555,10 +555,6 @@ quota::QuotaManager* TestingProfile::GetQuotaManager() { ...@@ -555,10 +555,6 @@ quota::QuotaManager* TestingProfile::GetQuotaManager() {
return quota_manager_.get(); return quota_manager_.get();
} }
BrowserSignin* TestingProfile::GetBrowserSignin() {
return NULL;
}
bool TestingProfile::HasCreatedDownloadManager() const { bool TestingProfile::HasCreatedDownloadManager() const {
return false; return false;
} }
......
...@@ -186,7 +186,6 @@ class TestingProfile : public Profile { ...@@ -186,7 +186,6 @@ class TestingProfile : public Profile {
virtual fileapi::FileSystemContext* GetFileSystemContext(); virtual fileapi::FileSystemContext* GetFileSystemContext();
virtual void SetQuotaManager(quota::QuotaManager* manager); virtual void SetQuotaManager(quota::QuotaManager* manager);
virtual quota::QuotaManager* GetQuotaManager(); virtual quota::QuotaManager* GetQuotaManager();
virtual BrowserSignin* GetBrowserSignin();
virtual bool HasCreatedDownloadManager() const; virtual bool HasCreatedDownloadManager() const;
// Returns a testing ContextGetter (if one has been created via // Returns a testing ContextGetter (if one has been created via
......
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