Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2677)

Unified Diff: chrome/browser/dom_ui/options/personal_options_handler.cc

Issue 6260002: Fix chromium-os:10777 and other sync related crashes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/dom_ui/options/personal_options_handler.cc
diff --git a/chrome/browser/dom_ui/options/personal_options_handler.cc b/chrome/browser/dom_ui/options/personal_options_handler.cc
index bc14c1f6e3eb8b723e28b9fa9c71aeb2853834ce..ec4e73b3b6c0759b04c150aeb9037ed3c622fdda 100644
--- a/chrome/browser/dom_ui/options/personal_options_handler.cc
+++ b/chrome/browser/dom_ui/options/personal_options_handler.cc
@@ -45,7 +45,7 @@ PersonalOptionsHandler::PersonalOptionsHandler() {
PersonalOptionsHandler::~PersonalOptionsHandler() {
ProfileSyncService* sync_service =
- dom_ui_->GetProfile()->GetProfileSyncService();
+ dom_ui_->GetOriginalProfile()->GetProfileSyncService();
if (sync_service)
sync_service->RemoveObserver(this);
}
@@ -153,7 +153,9 @@ void PersonalOptionsHandler::Observe(NotificationType type,
void PersonalOptionsHandler::OnStateChanged() {
string16 status_label;
string16 link_label;
- ProfileSyncService* service = dom_ui_->GetProfile()->GetProfileSyncService();
+ ProfileSyncService* service =
+ dom_ui_->GetOriginalProfile()->GetProfileSyncService();
+ DCHECK(service);
bool managed = service->IsManaged();
bool sync_setup_completed = service->HasSyncSetupCompleted();
bool status_has_error = sync_ui_util::GetStatusLabels(service,
@@ -256,7 +258,7 @@ void PersonalOptionsHandler::Initialize() {
ObserveThemeChanged();
ProfileSyncService* sync_service =
- dom_ui_->GetProfile()->GetProfileSyncService();
+ dom_ui_->GetOriginalProfile()->GetProfileSyncService();
if (sync_service) {
sync_service->AddObserver(this);
OnStateChanged();
@@ -274,7 +276,9 @@ void PersonalOptionsHandler::ShowSyncLoginDialog(const ListValue* args) {
dom_ui_->GetProfile()->GetBrowserSignin()->RequestSignin(
dom_ui_->tab_contents(), UTF8ToUTF16(email), message, this);
#else
- ProfileSyncService* service = dom_ui_->GetProfile()->GetProfileSyncService();
+ ProfileSyncService* service =
+ dom_ui_->GetOriginalProfile()->GetProfileSyncService();
+ DCHECK(service);
service->ShowLoginDialog(NULL);
ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS);
#endif

Powered by Google App Engine
This is Rietveld 408576698