summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/dom_ui')
-rw-r--r--chrome/browser/dom_ui/options/personal_options_handler.cc2
-rw-r--r--chrome/browser/dom_ui/options/sync_options_handler.cc7
2 files changed, 5 insertions, 4 deletions
diff --git a/chrome/browser/dom_ui/options/personal_options_handler.cc b/chrome/browser/dom_ui/options/personal_options_handler.cc
index bc14c1f..7102a7a 100644
--- a/chrome/browser/dom_ui/options/personal_options_handler.cc
+++ b/chrome/browser/dom_ui/options/personal_options_handler.cc
@@ -154,6 +154,7 @@ void PersonalOptionsHandler::OnStateChanged() {
string16 status_label;
string16 link_label;
ProfileSyncService* service = dom_ui_->GetProfile()->GetProfileSyncService();
+ DCHECK(service);
bool managed = service->IsManaged();
bool sync_setup_completed = service->HasSyncSetupCompleted();
bool status_has_error = sync_ui_util::GetStatusLabels(service,
@@ -275,6 +276,7 @@ void PersonalOptionsHandler::ShowSyncLoginDialog(const ListValue* args) {
dom_ui_->tab_contents(), UTF8ToUTF16(email), message, this);
#else
ProfileSyncService* service = dom_ui_->GetProfile()->GetProfileSyncService();
+ DCHECK(service);
service->ShowLoginDialog(NULL);
ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS);
#endif
diff --git a/chrome/browser/dom_ui/options/sync_options_handler.cc b/chrome/browser/dom_ui/options/sync_options_handler.cc
index e67050c..da9b080 100644
--- a/chrome/browser/dom_ui/options/sync_options_handler.cc
+++ b/chrome/browser/dom_ui/options/sync_options_handler.cc
@@ -59,10 +59,9 @@ void SyncOptionsHandler::GetLocalizedValues(
void SyncOptionsHandler::Initialize() {
ProfileSyncService* service =
- dom_ui_->GetProfile()->GetOriginalProfile()->GetProfileSyncService();
- // If service is unavailable for some good reason, 'IsEnabled()' method
- // should return false. Otherwise something is broken.
- DCHECK(service);
+ dom_ui_->GetProfile()->GetProfileSyncService();
+ if (!service)
+ return; // Can happen in ChromeOS if called before login.
DictionaryValue args;
SyncSetupFlow::GetArgsForConfigure(service, &args);