diff options
author | tim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-15 01:19:11 +0000 |
---|---|---|
committer | tim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-15 01:19:11 +0000 |
commit | 48352c11fe849f7f786c43bdfe293dc2c58d12c5 (patch) | |
tree | 57708d7e211d7cbcf2b81b1395740f5859a62aa1 /chrome/browser/sync | |
parent | 20cc723d102acb16b61789714bbf443ba3d7d1f5 (diff) | |
download | chromium_src-48352c11fe849f7f786c43bdfe293dc2c58d12c5.zip chromium_src-48352c11fe849f7f786c43bdfe293dc2c58d12c5.tar.gz chromium_src-48352c11fe849f7f786c43bdfe293dc2c58d12c5.tar.bz2 |
Some personalization cleanup:
- Removes ProfilePersonalization (which is why the CL appears huge)
- Makes Profile do the work ProfilePersonalization did for creating PSS
- cloudy:stats > about:sync
- Removes the cloudy:// scheme and uses chrome:// for resources.
(Note SyncResourcesSource is a straight copy of CloudyResourceSource).
- Moves prefs and switches to pref_names and chrome_switches.
BUG=none
TEST=ProfileSyncServiceTest, LiveBookmarkSyncTests, SyncSetupWizardTest
Review URL: http://codereview.chromium.org/164544
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23505 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync')
-rw-r--r-- | chrome/browser/sync/personalization.cc | 195 | ||||
-rw-r--r-- | chrome/browser/sync/personalization.h | 58 | ||||
-rw-r--r-- | chrome/browser/sync/profile_sync_service.cc | 58 | ||||
-rw-r--r-- | chrome/browser/sync/profile_sync_service.h | 14 | ||||
-rw-r--r-- | chrome/browser/sync/profile_sync_service_unittest.cc | 12 | ||||
-rw-r--r-- | chrome/browser/sync/resources/setup_flow.html | 4 | ||||
-rw-r--r-- | chrome/browser/sync/sync_status_ui_helper.cc | 3 |
7 files changed, 49 insertions, 295 deletions
diff --git a/chrome/browser/sync/personalization.cc b/chrome/browser/sync/personalization.cc index 8f0fc76..866149f 100644 --- a/chrome/browser/sync/personalization.cc +++ b/chrome/browser/sync/personalization.cc @@ -17,18 +17,19 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_url_handler.h" #include "chrome/browser/command_updater.h" +#include "chrome/browser/dom_ui/new_tab_page_sync_handler.h" #include "chrome/browser/options_window.h" #include "chrome/browser/profile.h" #include "chrome/browser/profile_manager.h" +#include "chrome/browser/sync/auth_error_state.h" +#include "chrome/browser/sync/personalization_strings.h" +#include "chrome/browser/sync/profile_sync_service.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/jstemplate_builder.h" #include "chrome/common/notification_service.h" #include "chrome/common/pref_service.h" -#include "chrome/browser/dom_ui/new_tab_page_sync_handler.h" -#include "chrome/browser/sync/personalization_strings.h" -#include "chrome/browser/sync/auth_error_state.h" -#include "chrome/browser/sync/profile_sync_service.h" +#include "chrome/common/url_constants.h" #include "googleurl/src/gurl.h" #include "grit/app_resources.h" #include "grit/browser_resources.h" @@ -36,34 +37,6 @@ using sync_api::SyncManager; -// TODO(ncarter): Move these switches into chrome_switches. They are here -// now because we want to keep them secret during early development. -namespace switches { - const wchar_t kSyncServiceURL[] = L"sync-url"; - const wchar_t kSyncServicePort[] = L"sync-port"; - const wchar_t kSyncUserForTest[] = L"sync-user-for-test"; - const wchar_t kSyncPasswordForTest[] = L"sync-password-for-test"; -} - -// TODO(munjal): Move these preferences to common/pref_names.h. -// Names of various preferences. -namespace prefs { - const wchar_t kSyncPath[] = L"sync"; - const wchar_t kSyncLastSyncedTime[] = L"sync.last_synced_time"; - const wchar_t kSyncUserName[] = L"sync.username"; - const wchar_t kSyncHasSetupCompleted[] = L"sync.has_setup_completed"; -} - -// Top-level path for our network layer DataSource. -static const char kCloudyResourcesPath[] = "resources"; -// Path for cloudy:stats page. -static const char kCloudyStatsPath[] = "stats"; -// Path for the gaia sync login dialog. -static const char kCloudyGaiaLoginPath[] = "gaialogin"; -static const char kCloudyMergeAndSyncPath[] = "mergeandsync"; -static const char kCloudyThrobberPath[] = "throbber.png"; -static const char kCloudySetupFlowPath[] = "setup"; - namespace Personalization { static std::wstring MakeAuthErrorText(AuthErrorState state) { @@ -79,58 +52,13 @@ static std::wstring MakeAuthErrorText(AuthErrorState state) { } } -bool IsSyncEnabled(Profile* profile) { - const CommandLine* command_line = CommandLine::ForCurrentProcess(); - if (!command_line->HasSwitch(switches::kEnableSync)) - return false; - return profile && profile->GetProfilePersonalization() != NULL; -} - bool NeedsDOMUI(const GURL& url) { - return url.SchemeIs(kPersonalizationScheme) && - (url.path().find(kCloudyGaiaLoginPath) != std::string::npos) || - (url.path().find(kCloudySetupFlowPath) != std::string::npos) || - (url.path().find(kCloudyMergeAndSyncPath) != std::string::npos); + return url.SchemeIs(chrome::kChromeUIScheme) && + (url.path().find(chrome::kSyncGaiaLoginPath) != std::string::npos) || + (url.path().find(chrome::kSyncSetupFlowPath) != std::string::npos) || + (url.path().find(chrome::kSyncMergeAndSyncPath) != std::string::npos); } -class CloudyResourceSource : public ChromeURLDataManager::DataSource { - public: - CloudyResourceSource() - : DataSource(kCloudyResourcesPath, MessageLoop::current()) { - } - virtual ~CloudyResourceSource() { } - - virtual void StartDataRequest(const std::string& path, int request_id); - - virtual std::string GetMimeType(const std::string& path) const { - if (path == kCloudyThrobberPath) - return "image/png"; - else - return "text/html"; - } - private: - DISALLOW_COPY_AND_ASSIGN(CloudyResourceSource); -}; - -class CloudyStatsSource : public ChromeURLDataManager::DataSource { - public: - CloudyStatsSource() : DataSource(kCloudyStatsPath, MessageLoop::current()) { - } - virtual ~CloudyStatsSource() { } - virtual void StartDataRequest(const std::string& path, int request_id) { - std::string response(MakeCloudyStats()); - scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes); - html_bytes->data.resize(response.size()); - std::copy(response.begin(), response.end(), html_bytes->data.begin()); - SendResponse(request_id, html_bytes); - } - virtual std::string GetMimeType(const std::string& path) const { - return "text/html"; - } - private: - DISALLOW_COPY_AND_ASSIGN(CloudyStatsSource); -}; - DOMMessageHandler* CreateNewTabPageHandler(DOMUI* dom_ui) { return (new NewTabPageSyncHandler())->Attach(dom_ui); } @@ -154,9 +82,10 @@ void HandleMenuItemClick(Profile* p) { // The menu item is enabled either when the sync is not enabled by the user // or when it's enabled but the user name is empty. In the former case enable // sync. In the latter case, show the login dialog. - ProfileSyncService* service = p->GetProfilePersonalization()->sync_service(); - DCHECK(service); - if (service->IsSyncEnabledByUser()) { + ProfileSyncService* service = p->GetProfileSyncService(); + if (!service) + return; // Incognito has no sync service (or TestingProfile, etc). + if (service->HasSyncSetupCompleted()) { ShowOptionsWindow(OPTIONS_PAGE_CONTENT, OPTIONS_GROUP_NONE, p); } else { service->EnableForUser(); @@ -166,99 +95,8 @@ void HandleMenuItemClick(Profile* p) { } // namespace Personalization -class ProfilePersonalizationImpl : public ProfilePersonalization, - public NotificationObserver { - public: - explicit ProfilePersonalizationImpl(Profile *p) - : profile_(p) { - // g_browser_process and/or io_thread may not exist during testing. - if (g_browser_process && g_browser_process->io_thread()) { - // Add our network layer data source for 'cloudy' URLs. - // TODO(timsteele): This one belongs in BrowserAboutHandler. - g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, - NewRunnableMethod(&chrome_url_data_manager, - &ChromeURLDataManager::AddDataSource, - new Personalization::CloudyStatsSource())); - g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, - NewRunnableMethod(&chrome_url_data_manager, - &ChromeURLDataManager::AddDataSource, - new Personalization::CloudyResourceSource())); - } - - registrar_.Add(this, NotificationType::BOOKMARK_MODEL_LOADED, - Source<Profile>(profile_)); - } - virtual ~ProfilePersonalizationImpl() {} - - // ProfilePersonalization implementation - virtual ProfileSyncService* sync_service() { - if (!sync_service_.get()) - InitSyncService(); - return sync_service_.get(); - } - - // NotificationObserver implementation. - virtual void Observe(NotificationType type, - const NotificationSource& source, - const NotificationDetails& details) { - DCHECK_EQ(type.value, NotificationType::BOOKMARK_MODEL_LOADED); - if (!sync_service_.get()) - InitSyncService(); - registrar_.RemoveAll(); - } - - void InitSyncService() { - sync_service_.reset(new ProfileSyncService(profile_)); - sync_service_->Initialize(); - } - - private: - Profile* profile_; - NotificationRegistrar registrar_; - scoped_ptr<ProfileSyncService> sync_service_; - DISALLOW_COPY_AND_ASSIGN(ProfilePersonalizationImpl); -}; - namespace Personalization { -void CloudyResourceSource::StartDataRequest(const std::string& path_raw, - int request_id) { - scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes); - if (path_raw == kCloudyThrobberPath) { - ResourceBundle::GetSharedInstance().LoadImageResourceBytes(IDR_THROBBER, - &html_bytes->data); - SendResponse(request_id, html_bytes); - return; - } - - std::string response; - if (path_raw == kCloudyGaiaLoginPath) { - static const StringPiece html(ResourceBundle::GetSharedInstance() - .GetRawDataResource(IDR_GAIA_LOGIN_HTML)); - response = html.as_string(); - } else if (path_raw == kCloudyMergeAndSyncPath) { - static const StringPiece html(ResourceBundle::GetSharedInstance() - .GetRawDataResource(IDR_MERGE_AND_SYNC_HTML)); - response = html.as_string(); - } else if (path_raw == kCloudySetupFlowPath) { - static const StringPiece html(ResourceBundle::GetSharedInstance() - .GetRawDataResource(IDR_SYNC_SETUP_FLOW_HTML)); - response = html.as_string(); - } - // Send the response. - html_bytes->data.resize(response.size()); - std::copy(response.begin(), response.end(), html_bytes->data.begin()); - SendResponse(request_id, html_bytes); -} - -ProfilePersonalization* CreateProfilePersonalization(Profile* p) { - return new ProfilePersonalizationImpl(p); -} - -void CleanupProfilePersonalization(ProfilePersonalization* p) { - if (p) delete p; -} - static void AddBoolDetail(ListValue* details, const std::wstring& stat_name, bool stat_value) { DictionaryValue* val = new DictionaryValue; @@ -275,17 +113,16 @@ static void AddIntDetail(ListValue* details, const std::wstring& stat_name, details->Append(val); } -std::string MakeCloudyStats() { +std::string AboutSync() { FilePath user_data_dir; if (!PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) return std::string(); ProfileManager* profile_manager = g_browser_process->profile_manager(); Profile* profile = profile_manager->GetDefaultProfile(user_data_dir); - ProfilePersonalization* p13n_profile = profile->GetProfilePersonalization(); - ProfileSyncService* service = p13n_profile->sync_service(); + ProfileSyncService* service = profile->GetProfileSyncService(); DictionaryValue strings; - if (!service->IsSyncEnabledByUser()) { + if (!service || !service->HasSyncSetupCompleted()) { strings.SetString(L"summary", L"SYNC DISABLED"); } else { SyncManager::Status full_status(service->QueryDetailedSyncStatus()); diff --git a/chrome/browser/sync/personalization.h b/chrome/browser/sync/personalization.h index f278d28d..fb6a4ed 100644 --- a/chrome/browser/sync/personalization.h +++ b/chrome/browser/sync/personalization.h @@ -27,58 +27,15 @@ class ProfileSyncServiceObserver; namespace views { class View; } -// TODO(ncarter): Move these switches into chrome_switches. They are here -// now because we want to keep them secret during early development. -namespace switches { -extern const wchar_t kSyncServiceURL[]; -extern const wchar_t kSyncServicePort[]; -extern const wchar_t kSyncUserForTest[]; -extern const wchar_t kSyncPasswordForTest[]; -} - -// Names of various preferences. -// TODO(munjal): Move these preferences to common/pref_names.h. -namespace prefs { -extern const wchar_t kSyncPath[]; -extern const wchar_t kSyncLastSyncedTime[]; -extern const wchar_t kSyncUserName[]; -extern const wchar_t kSyncHasSetupCompleted[]; -} - -// Contains a profile sync service, which is initialized at profile creation. -// A pointer to this class is passed as a handle. -class ProfilePersonalization { - public: - ProfilePersonalization() {} - virtual ~ProfilePersonalization() {} - - virtual ProfileSyncService* sync_service() = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(ProfilePersonalization); -}; - // Contains methods to perform Personalization-related tasks on behalf of the // caller. namespace Personalization { -// Checks if P13N is globally disabled or not, and that |profile| has a valid -// ProfilePersonalization member (it can be NULL for TestingProfiles). -bool IsSyncEnabled(Profile* profile); - // Returns whether |url| should be loaded in a DOMUI. bool NeedsDOMUI(const GURL& url); -// Construct a new ProfilePersonalization and return it so the caller can take -// ownership. -ProfilePersonalization* CreateProfilePersonalization(Profile* p); - -// The caller of Create...() above should call this when the returned -// ProfilePersonalization object should be deleted. -void CleanupProfilePersonalization(ProfilePersonalization* p); - -// Handler for "cloudy:stats" -std::string MakeCloudyStats(); +// Handler for "about:sync" +std::string AboutSync(); // Construct a new DOMMessageHandler for the new tab page |dom_ui|. DOMMessageHandler* CreateNewTabPageHandler(DOMUI* dom_ui); @@ -94,16 +51,5 @@ std::wstring GetMenuItemInfoText(Browser* browser); void HandleMenuItemClick(Profile* p); } // namespace Personalization -// The internal scheme used to retrieve HTML resources for personalization -// related code (e.g cloudy:stats, GAIA login page). -// We need to ensure the GAIA login HTML is loaded into an HTMLDialogContents. -// Outside of p13n (for the time being) only "gears://" gives this (see -// HtmlDialogContents::IsHtmlDialogUrl) for the application shortcut dialog. -// TODO(timsteele): We should have a robust way to handle this to allow more -// reuse of our HTML dialog code, perhaps by using a dedicated "dialog-resource" -// scheme (chrome-resource is coupled to DOM_UI). Figure out if that is the best -// course of action / pitch this idea to chromium-dev. -static const char kPersonalizationScheme[] = "cloudy"; - #endif // CHROME_BROWSER_SYNC_PERSONALIZATION_H_ #endif // CHROME_PERSONALIZATION diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc index 7e89449..4de8f38 100644 --- a/chrome/browser/sync/profile_sync_service.cc +++ b/chrome/browser/sync/profile_sync_service.cc @@ -25,6 +25,7 @@ #include "chrome/browser/sync/personalization.h" #include "chrome/browser/sync/personalization_strings.h" #include "chrome/common/chrome_switches.h" +#include "chrome/common/pref_names.h" #include "chrome/common/pref_service.h" #include "chrome/common/time_format.h" #include "views/window/window.h" @@ -32,8 +33,8 @@ using browser_sync::ModelAssociator; using browser_sync::SyncBackendHost; -// Default sync server URL. -static const char kSyncServerUrl[] = "https://clients4.google.com/chrome-sync"; +// Default sync server URL. +static const char kSyncServerUrl[] = "https://clients4.google.com/chrome-sync"; ProfileSyncService::ProfileSyncService(Profile* profile) : last_auth_error_(AUTH_ERROR_NONE), @@ -77,46 +78,18 @@ void ProfileSyncService::InitSettings() { } } } - - if (command_line.HasSwitch(switches::kSyncServicePort)) { - std::string port_str = WideToUTF8(command_line.GetSwitchValue( - switches::kSyncServicePort)); - if (!port_str.empty()) { - GURL::Replacements replacements; - replacements.SetPortStr(port_str); - sync_service_url_ = sync_service_url_.ReplaceComponents(replacements); - } - } } void ProfileSyncService::RegisterPreferences() { PrefService* pref_service = profile_->GetPrefs(); - if (pref_service->IsPrefRegistered(prefs::kSyncUserName)) + if (pref_service->IsPrefRegistered(prefs::kSyncLastSyncedTime)) return; - pref_service->RegisterStringPref(prefs::kSyncUserName, std::wstring()); - pref_service->RegisterStringPref(prefs::kSyncLastSyncedTime, std::wstring()); + pref_service->RegisterInt64Pref(prefs::kSyncLastSyncedTime, 0); pref_service->RegisterBooleanPref(prefs::kSyncHasSetupCompleted, false); } -void ProfileSyncService::LoadPreferences() { - PrefService* pref_service = profile_->GetPrefs(); - std::wstring last_synced_time_string = - pref_service->GetString(prefs::kSyncLastSyncedTime); - if (!last_synced_time_string.empty()) { - int64 last_synced_time; - bool success = StringToInt64(WideToUTF16(last_synced_time_string), - &last_synced_time); - if (success) { - last_synced_time_ = base::Time::FromInternalValue(last_synced_time); - } else { - NOTREACHED(); - } - } -} - void ProfileSyncService::ClearPreferences() { PrefService* pref_service = profile_->GetPrefs(); - pref_service->ClearPref(prefs::kSyncUserName); pref_service->ClearPref(prefs::kSyncLastSyncedTime); pref_service->ClearPref(prefs::kSyncHasSetupCompleted); @@ -132,7 +105,8 @@ void ProfileSyncService::StartUp() { if (backend_.get()) return; - LoadPreferences(); + last_synced_time_ = base::Time::FromInternalValue( + profile_->GetPrefs()->GetInt64(prefs::kSyncLastSyncedTime)); backend_.reset(new SyncBackendHost(this, profile_->GetPath())); @@ -291,14 +265,21 @@ bool ProfileSyncService::MergeAndSyncAcceptanceNeeded() const { model_associator_->SyncModelHasUserCreatedNodes(); } -bool ProfileSyncService::IsSyncEnabledByUser() const { +bool ProfileSyncService::HasSyncSetupCompleted() const { return profile_->GetPrefs()->GetBoolean(prefs::kSyncHasSetupCompleted); } +void ProfileSyncService::SetSyncSetupCompleted() { + PrefService* prefs = profile()->GetPrefs(); + prefs->SetBoolean(prefs::kSyncHasSetupCompleted, true); + prefs->ScheduleSavePersistentPrefs(); +} + void ProfileSyncService::UpdateLastSyncedTime() { last_synced_time_ = base::Time::Now(); - profile_->GetPrefs()->SetString(prefs::kSyncLastSyncedTime, - Int64ToWString(last_synced_time_.ToInternalValue())); + profile_->GetPrefs()->SetInt64(prefs::kSyncLastSyncedTime, + last_synced_time_.ToInternalValue()); + profile_->GetPrefs()->ScheduleSavePersistentPrefs(); } void ProfileSyncService::BookmarkNodeAdded(BookmarkModel* model, @@ -519,11 +500,6 @@ int ProfileSyncService::CalculateBookmarkModelInsertionIndex( void ProfileSyncService::OnBackendInitialized() { backend_initialized_ = true; - - PrefService* pref_service = profile_->GetPrefs(); - DCHECK(pref_service->IsPrefRegistered(prefs::kSyncUserName)); - pref_service->SetString(prefs::kSyncUserName, - UTF16ToWide(backend_->GetAuthenticatedUsername())); StartProcessingChangesIfReady(); // The very first time the backend initializes is effectively the first time diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h index 0301647..a2f956b 100644 --- a/chrome/browser/sync/profile_sync_service.h +++ b/chrome/browser/sync/profile_sync_service.h @@ -88,7 +88,8 @@ class ProfileSyncService : public BookmarkModelObserver, virtual void DisableForUser(); // Whether sync is enabled by user or not. - bool IsSyncEnabledByUser() const; + bool HasSyncSetupCompleted() const; + void SetSyncSetupCompleted(); // BookmarkModelObserver implementation. virtual void Loaded(BookmarkModel* model); @@ -146,7 +147,7 @@ class ProfileSyncService : public BookmarkModelObserver, // occurred preventing the action. We make it the duty of ProfileSyncService // to open the dialog to easily ensure only one is ever showing. bool SetupInProgress() const { - return !IsSyncEnabledByUser() && WizardIsVisible(); + return !HasSyncSetupCompleted() && WizardIsVisible(); } bool WizardIsVisible() const { return wizard_.IsVisible(); } void ShowLoginDialog(); @@ -221,6 +222,10 @@ class ProfileSyncService : public BookmarkModelObserver, // |sync_disabled| indicates if syncing is being disabled or not. void Shutdown(bool sync_disabled); + // Methods to register and remove preferences. + void RegisterPreferences(); + void ClearPreferences(); + // Tests need to override this. virtual void InitializeBackend(); @@ -253,11 +258,6 @@ class ProfileSyncService : public BookmarkModelObserver, // Initializes the various settings from the command line. void InitSettings(); - // Methods to register, load and remove preferences. - void RegisterPreferences(); - void LoadPreferences(); - void ClearPreferences(); - // Treat the |index|th child of |parent| as a newly added node, and create a // corresponding node in the sync domain using |trans|. All properties // will be transferred to the new node. A node corresponding to |parent| diff --git a/chrome/browser/sync/profile_sync_service_unittest.cc b/chrome/browser/sync/profile_sync_service_unittest.cc index 5fc79f4..cc7f4c6 100644 --- a/chrome/browser/sync/profile_sync_service_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_unittest.cc @@ -18,7 +18,7 @@ #include "chrome/browser/sync/engine/syncapi.h" #include "chrome/browser/sync/glue/model_associator.h" #include "chrome/browser/sync/profile_sync_service.h" -#include "chrome/common/pref_service.h" +#include "chrome/common/chrome_switches.h" #include "chrome/test/testing_profile.h" using std::vector; @@ -68,12 +68,8 @@ class TestProfileSyncService : public ProfileSyncService { public: explicit TestProfileSyncService(Profile* profile) : ProfileSyncService(profile) { - PrefService* pref_service = profile->GetPrefs(); - if (pref_service->IsPrefRegistered(prefs::kSyncUserName)) - return; - pref_service->RegisterStringPref(prefs::kSyncUserName, string16()); - pref_service->RegisterStringPref(prefs::kSyncLastSyncedTime, string16()); - pref_service->RegisterBooleanPref(prefs::kSyncHasSetupCompleted, true); + RegisterPreferences(); + SetSyncSetupCompleted(); } virtual ~TestProfileSyncService() { } @@ -284,7 +280,7 @@ class ProfileSyncServiceTest : public testing::Test { } // The service may have already started sync automatically if it's already // enabled by user once. - if (!service_->IsSyncEnabledByUser()) + if (!service_->HasSyncSetupCompleted()) service_->EnableForUser(); } void StopSyncService(SaveOption save) { diff --git a/chrome/browser/sync/resources/setup_flow.html b/chrome/browser/sync/resources/setup_flow.html index 82db8a9..f818787 100644 --- a/chrome/browser/sync/resources/setup_flow.html +++ b/chrome/browser/sync/resources/setup_flow.html @@ -12,8 +12,8 @@ </HEAD> <BODY style="margin:0; border:0;"> <iframe id="login" frameborder="0" width="100%" scrolling="no" height="100%" - src="cloudy://resources/gaialogin"></iframe> + src="chrome://syncresources/gaialogin"></iframe> <iframe id="merge" frameborder="0" width="100%" scrolling="no" height="100%" - src="cloudy://resources/mergeandsync" style="display:none"></iframe> + src="chrome://syncresources/mergeandsync" style="display:none"></iframe> </BODY> </HTML> diff --git a/chrome/browser/sync/sync_status_ui_helper.cc b/chrome/browser/sync/sync_status_ui_helper.cc index 586cd6f..d16068f 100644 --- a/chrome/browser/sync/sync_status_ui_helper.cc +++ b/chrome/browser/sync/sync_status_ui_helper.cc @@ -60,9 +60,8 @@ SyncStatusUIHelper::MessageType SyncStatusUIHelper::GetLabels( ProfileSyncService* service, std::wstring* status_label, std::wstring* link_label) { MessageType result_type(SYNCED); - bool sync_enabled = service->IsSyncEnabledByUser(); - if (sync_enabled) { + if (service->HasSyncSetupCompleted()) { ProfileSyncService::Status status(service->QueryDetailedSyncStatus()); AuthErrorState auth_error(service->GetAuthErrorState()); |