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

Unified Diff: chrome/browser/ui/toolbar/wrench_menu_model.cc

Issue 12088040: Add a SigninAllowed policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address nits and rebase to ToT. Created 7 years, 10 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/ui/toolbar/wrench_menu_model.cc
diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc
index 2ee902ca3b09d28fc5f7da31cff253bd034a73f3..a3aa19fce1b4403a4d13938133e1f43fd03beb2c 100644
--- a/chrome/browser/ui/toolbar/wrench_menu_model.cc
+++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc
@@ -18,6 +18,8 @@
#include "chrome/browser/defaults.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/signin/signin_manager.h"
+#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/signin/signin_ui_util.h"
#include "chrome/browser/task_manager/task_manager.h"
#include "chrome/browser/ui/browser.h"
@@ -550,11 +552,15 @@ void WrenchMenuModel::Build(bool is_new_menu, bool supports_new_separators) {
#if !defined(OS_CHROMEOS)
// No "Sign in to Chromium..." menu item on ChromeOS.
- const string16 short_product_name =
- l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME);
- AddItem(IDC_SHOW_SYNC_SETUP, l10n_util::GetStringFUTF16(
- IDS_SYNC_MENU_PRE_SYNCED_LABEL, short_product_name));
- AddSeparator(ui::NORMAL_SEPARATOR);
+ SigninManager* signin = SigninManagerFactory::GetForProfile(
+ browser_->profile()->GetOriginalProfile());
+ if (signin && signin->IsSigninAllowed()) {
+ const string16 short_product_name =
+ l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME);
+ AddItem(IDC_SHOW_SYNC_SETUP, l10n_util::GetStringFUTF16(
+ IDS_SYNC_MENU_PRE_SYNCED_LABEL, short_product_name));
+ AddSeparator(ui::NORMAL_SEPARATOR);
+ }
#endif
AddItemWithStringId(IDC_OPTIONS, IDS_SETTINGS);
« no previous file with comments | « chrome/browser/ui/sync/one_click_signin_helper_unittest.cc ('k') | chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698