| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |