summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authortim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-30 20:02:14 +0000
committertim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-30 20:02:14 +0000
commit5cc4bc0dd4df78d41504088a6e3502ac376db3d9 (patch)
tree9b9b85e223562c481720c967db0f4a39fa271995 /chrome
parenteeba91ac5369e2e11b5a8dece974399de09454aa (diff)
downloadchromium_src-5cc4bc0dd4df78d41504088a6e3502ac376db3d9.zip
chromium_src-5cc4bc0dd4df78d41504088a6e3502ac376db3d9.tar.gz
chromium_src-5cc4bc0dd4df78d41504088a6e3502ac376db3d9.tar.bz2
Use the original profile to get the sync service when building the app menu.
BUG=23993 TEST=Open incognito window. Click the bookmark sync button. Either the signin dialog or the options panel should open. Review URL: http://codereview.chromium.org/350005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30624 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/browser.cc12
-rw-r--r--chrome/browser/views/toolbar_view.cc3
2 files changed, 9 insertions, 6 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index a2a0e96..71ef534 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -679,8 +679,8 @@ void Browser::UpdateCommandsForFullscreenMode(bool is_fullscreen) {
command_updater_.UpdateCommandEnabled(IDC_SHOW_BOOKMARK_BAR, show_main_ui);
command_updater_.UpdateCommandEnabled(IDC_IMPORT_SETTINGS, show_main_ui);
command_updater_.UpdateCommandEnabled(
- IDC_SYNC_BOOKMARKS,
- show_main_ui && profile_->GetProfileSyncService() != NULL);
+ IDC_SYNC_BOOKMARKS, show_main_ui &&
+ profile_->GetOriginalProfile()->GetProfileSyncService() != NULL);
command_updater_.UpdateCommandEnabled(IDC_OPTIONS, show_main_ui);
command_updater_.UpdateCommandEnabled(IDC_EDIT_SEARCH_ENGINES, show_main_ui);
command_updater_.UpdateCommandEnabled(IDC_VIEW_PASSWORDS, show_main_ui);
@@ -1226,11 +1226,13 @@ void Browser::OpenImportSettingsDialog() {
}
void Browser::OpenSyncMyBookmarksDialog() {
- ProfileSyncService* service = profile_->GetProfileSyncService();
- // TODO(timsteele): Incognito has no sync service for the time being,
- // so protect against this case.
+ ProfileSyncService* service =
+ profile_->GetOriginalProfile()->GetProfileSyncService();
+ // It shouldn't be possible to be in this function without a service.
+ DCHECK(service);
if (!service)
return;
+
if (service->HasSyncSetupCompleted()) {
ShowOptionsWindow(OPTIONS_PAGE_CONTENT, OPTIONS_GROUP_NONE, profile_);
} else {
diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc
index 8194729..4721675 100644
--- a/chrome/browser/views/toolbar_view.cc
+++ b/chrome/browser/views/toolbar_view.cc
@@ -1179,7 +1179,8 @@ void ToolbarView::CreateAppMenu() {
// TODO(timsteele): Need a ui helper method to just get the type without
// needing labels.
SyncStatusUIHelper::MessageType type = SyncStatusUIHelper::GetLabels(
- browser_->profile()->GetProfileSyncService(), &label, &link);
+ browser_->profile()->GetOriginalProfile()->GetProfileSyncService(),
+ &label, &link);
label = type == SyncStatusUIHelper::SYNCED ?
l10n_util::GetStringUTF16(IDS_SYNC_MENU_BOOKMARKS_SYNCED_LABEL) :
type == SyncStatusUIHelper::SYNC_ERROR ?