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

Side by Side Diff: chrome/browser/views/toolbar_view.cc

Issue 350005: Use the original profile to get the sync service when building the app menu.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/browser.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/views/toolbar_view.h" 5 #include "chrome/browser/views/toolbar_view.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "app/drag_drop_types.h" 9 #include "app/drag_drop_types.h"
10 #include "app/gfx/canvas.h" 10 #include "app/gfx/canvas.h"
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1172 app_menu_contents_->AddItemWithStringId(IDC_MANAGE_EXTENSIONS, 1172 app_menu_contents_->AddItemWithStringId(IDC_MANAGE_EXTENSIONS,
1173 IDS_SHOW_EXTENSIONS); 1173 IDS_SHOW_EXTENSIONS);
1174 1174
1175 app_menu_contents_->AddSeparator(); 1175 app_menu_contents_->AddSeparator();
1176 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableSync)) { 1176 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableSync)) {
1177 string16 label; 1177 string16 label;
1178 string16 link; 1178 string16 link;
1179 // TODO(timsteele): Need a ui helper method to just get the type without 1179 // TODO(timsteele): Need a ui helper method to just get the type without
1180 // needing labels. 1180 // needing labels.
1181 SyncStatusUIHelper::MessageType type = SyncStatusUIHelper::GetLabels( 1181 SyncStatusUIHelper::MessageType type = SyncStatusUIHelper::GetLabels(
1182 browser_->profile()->GetProfileSyncService(), &label, &link); 1182 browser_->profile()->GetOriginalProfile()->GetProfileSyncService(),
1183 &label, &link);
1183 label = type == SyncStatusUIHelper::SYNCED ? 1184 label = type == SyncStatusUIHelper::SYNCED ?
1184 l10n_util::GetStringUTF16(IDS_SYNC_MENU_BOOKMARKS_SYNCED_LABEL) : 1185 l10n_util::GetStringUTF16(IDS_SYNC_MENU_BOOKMARKS_SYNCED_LABEL) :
1185 type == SyncStatusUIHelper::SYNC_ERROR ? 1186 type == SyncStatusUIHelper::SYNC_ERROR ?
1186 l10n_util::GetStringUTF16(IDS_SYNC_MENU_BOOKMARK_SYNC_ERROR_LABEL) : 1187 l10n_util::GetStringUTF16(IDS_SYNC_MENU_BOOKMARK_SYNC_ERROR_LABEL) :
1187 l10n_util::GetStringUTF16(IDS_SYNC_START_SYNC_BUTTON_LABEL); 1188 l10n_util::GetStringUTF16(IDS_SYNC_START_SYNC_BUTTON_LABEL);
1188 app_menu_contents_->AddItem(IDC_SYNC_BOOKMARKS, label); 1189 app_menu_contents_->AddItem(IDC_SYNC_BOOKMARKS, label);
1189 app_menu_contents_->AddSeparator(); 1190 app_menu_contents_->AddSeparator();
1190 } 1191 }
1191 app_menu_contents_->AddItem(IDC_OPTIONS, 1192 app_menu_contents_->AddItem(IDC_OPTIONS,
1192 l10n_util::GetStringFUTF16( 1193 l10n_util::GetStringFUTF16(
1193 IDS_OPTIONS, 1194 IDS_OPTIONS,
1194 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); 1195 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
1195 app_menu_contents_->AddItem(IDC_ABOUT, 1196 app_menu_contents_->AddItem(IDC_ABOUT,
1196 l10n_util::GetStringFUTF16( 1197 l10n_util::GetStringFUTF16(
1197 IDS_ABOUT, 1198 IDS_ABOUT,
1198 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); 1199 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
1199 app_menu_contents_->AddItemWithStringId(IDC_HELP_PAGE, IDS_HELP_PAGE); 1200 app_menu_contents_->AddItemWithStringId(IDC_HELP_PAGE, IDS_HELP_PAGE);
1200 app_menu_contents_->AddSeparator(); 1201 app_menu_contents_->AddSeparator();
1201 app_menu_contents_->AddItemWithStringId(IDC_EXIT, IDS_EXIT); 1202 app_menu_contents_->AddItemWithStringId(IDC_EXIT, IDS_EXIT);
1202 1203
1203 app_menu_menu_.reset(new views::Menu2(app_menu_contents_.get())); 1204 app_menu_menu_.reset(new views::Menu2(app_menu_contents_.get()));
1204 } 1205 }
OLDNEW
« no previous file with comments | « chrome/browser/browser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698