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

Side by Side Diff: chrome/browser/ui/browser.cc

Issue 7511024: [Sync] [Mac] Show sync menu item in app menu even in incognito mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/ui/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #endif // OS_WIN 10 #endif // OS_WIN
(...skipping 3743 matching lines...) Expand 10 before | Expand all | Expand 10 after
3754 void Browser::OnStateChanged() { 3754 void Browser::OnStateChanged() {
3755 DCHECK(profile_->GetProfileSyncService()); 3755 DCHECK(profile_->GetProfileSyncService());
3756 3756
3757 #if !defined(OS_MACOSX) 3757 #if !defined(OS_MACOSX)
3758 const bool show_main_ui = is_type_tabbed() && !window_->IsFullscreen(); 3758 const bool show_main_ui = is_type_tabbed() && !window_->IsFullscreen();
3759 #else 3759 #else
3760 const bool show_main_ui = is_type_tabbed(); 3760 const bool show_main_ui = is_type_tabbed();
3761 #endif 3761 #endif
3762 3762
3763 command_updater_.UpdateCommandEnabled(IDC_SYNC_BOOKMARKS, 3763 command_updater_.UpdateCommandEnabled(IDC_SYNC_BOOKMARKS,
3764 show_main_ui && profile_->IsSyncAccessible()); 3764 show_main_ui && profile_->GetOriginalProfile()->IsSyncAccessible());
3765 } 3765 }
3766 3766
3767 /////////////////////////////////////////////////////////////////////////////// 3767 ///////////////////////////////////////////////////////////////////////////////
3768 // Browser, InstantDelegate implementation: 3768 // Browser, InstantDelegate implementation:
3769 3769
3770 void Browser::PrepareForInstant() { 3770 void Browser::PrepareForInstant() {
3771 window_->PrepareForInstant(); 3771 window_->PrepareForInstant();
3772 } 3772 }
3773 3773
3774 void Browser::ShowInstant(TabContentsWrapper* preview_contents) { 3774 void Browser::ShowInstant(TabContentsWrapper* preview_contents) {
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
4019 command_updater_.UpdateCommandEnabled( 4019 command_updater_.UpdateCommandEnabled(
4020 IDC_FOCUS_CHROMEOS_STATUS, main_not_fullscreen); 4020 IDC_FOCUS_CHROMEOS_STATUS, main_not_fullscreen);
4021 4021
4022 // Show various bits of UI 4022 // Show various bits of UI
4023 command_updater_.UpdateCommandEnabled(IDC_DEVELOPER_MENU, show_main_ui); 4023 command_updater_.UpdateCommandEnabled(IDC_DEVELOPER_MENU, show_main_ui);
4024 command_updater_.UpdateCommandEnabled(IDC_FEEDBACK, show_main_ui); 4024 command_updater_.UpdateCommandEnabled(IDC_FEEDBACK, show_main_ui);
4025 command_updater_.UpdateCommandEnabled(IDC_SHOW_BOOKMARK_BAR, 4025 command_updater_.UpdateCommandEnabled(IDC_SHOW_BOOKMARK_BAR,
4026 browser_defaults::bookmarks_enabled && show_main_ui); 4026 browser_defaults::bookmarks_enabled && show_main_ui);
4027 command_updater_.UpdateCommandEnabled(IDC_IMPORT_SETTINGS, show_main_ui); 4027 command_updater_.UpdateCommandEnabled(IDC_IMPORT_SETTINGS, show_main_ui);
4028 command_updater_.UpdateCommandEnabled(IDC_SYNC_BOOKMARKS, 4028 command_updater_.UpdateCommandEnabled(IDC_SYNC_BOOKMARKS,
4029 show_main_ui && profile_->IsSyncAccessible()); 4029 show_main_ui && profile_->GetOriginalProfile()->IsSyncAccessible());
4030 4030
4031 command_updater_.UpdateCommandEnabled(IDC_OPTIONS, show_main_ui); 4031 command_updater_.UpdateCommandEnabled(IDC_OPTIONS, show_main_ui);
4032 command_updater_.UpdateCommandEnabled(IDC_EDIT_SEARCH_ENGINES, show_main_ui); 4032 command_updater_.UpdateCommandEnabled(IDC_EDIT_SEARCH_ENGINES, show_main_ui);
4033 command_updater_.UpdateCommandEnabled(IDC_VIEW_PASSWORDS, show_main_ui); 4033 command_updater_.UpdateCommandEnabled(IDC_VIEW_PASSWORDS, show_main_ui);
4034 command_updater_.UpdateCommandEnabled(IDC_ABOUT, show_main_ui); 4034 command_updater_.UpdateCommandEnabled(IDC_ABOUT, show_main_ui);
4035 command_updater_.UpdateCommandEnabled(IDC_SHOW_APP_MENU, show_main_ui); 4035 command_updater_.UpdateCommandEnabled(IDC_SHOW_APP_MENU, show_main_ui);
4036 command_updater_.UpdateCommandEnabled(IDC_TOGGLE_VERTICAL_TABS, show_main_ui); 4036 command_updater_.UpdateCommandEnabled(IDC_TOGGLE_VERTICAL_TABS, show_main_ui);
4037 command_updater_.UpdateCommandEnabled(IDC_COMPACT_NAVBAR, show_main_ui); 4037 command_updater_.UpdateCommandEnabled(IDC_COMPACT_NAVBAR, show_main_ui);
4038 #if defined (ENABLE_PROFILING) && !defined(NO_TCMALLOC) 4038 #if defined (ENABLE_PROFILING) && !defined(NO_TCMALLOC)
4039 command_updater_.UpdateCommandEnabled(IDC_PROFILING_ENABLED, show_main_ui); 4039 command_updater_.UpdateCommandEnabled(IDC_PROFILING_ENABLED, show_main_ui);
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
4815 } 4815 }
4816 4816
4817 void Browser::ShowSyncSetup() { 4817 void Browser::ShowSyncSetup() {
4818 ProfileSyncService* service = 4818 ProfileSyncService* service =
4819 profile()->GetOriginalProfile()->GetProfileSyncService(); 4819 profile()->GetOriginalProfile()->GetProfileSyncService();
4820 if (service->HasSyncSetupCompleted()) 4820 if (service->HasSyncSetupCompleted())
4821 ShowOptionsTab(chrome::kSyncSetupSubPage); 4821 ShowOptionsTab(chrome::kSyncSetupSubPage);
4822 else 4822 else
4823 service->ShowLoginDialog(); 4823 service->ShowLoginDialog();
4824 } 4824 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698