| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-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/browser.h" | 5 #include "chrome/browser/browser.h" |
| 6 | 6 |
| 7 #include "app/animation.h" | 7 #include "app/animation.h" |
| 8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/keyboard_codes.h" | 10 #include "base/keyboard_codes.h" |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 command_updater_.UpdateCommandEnabled(IDC_FOCUS_TOOLBAR, show_main_ui); | 646 command_updater_.UpdateCommandEnabled(IDC_FOCUS_TOOLBAR, show_main_ui); |
| 647 command_updater_.UpdateCommandEnabled(IDC_FOCUS_LOCATION, show_main_ui); | 647 command_updater_.UpdateCommandEnabled(IDC_FOCUS_LOCATION, show_main_ui); |
| 648 command_updater_.UpdateCommandEnabled(IDC_FOCUS_SEARCH, show_main_ui); | 648 command_updater_.UpdateCommandEnabled(IDC_FOCUS_SEARCH, show_main_ui); |
| 649 | 649 |
| 650 // Show various bits of UI | 650 // Show various bits of UI |
| 651 command_updater_.UpdateCommandEnabled(IDC_DEVELOPER_MENU, show_main_ui); | 651 command_updater_.UpdateCommandEnabled(IDC_DEVELOPER_MENU, show_main_ui); |
| 652 command_updater_.UpdateCommandEnabled(IDC_NEW_PROFILE, show_main_ui); | 652 command_updater_.UpdateCommandEnabled(IDC_NEW_PROFILE, show_main_ui); |
| 653 command_updater_.UpdateCommandEnabled(IDC_REPORT_BUG, show_main_ui); | 653 command_updater_.UpdateCommandEnabled(IDC_REPORT_BUG, show_main_ui); |
| 654 command_updater_.UpdateCommandEnabled(IDC_SHOW_BOOKMARK_BAR, show_main_ui); | 654 command_updater_.UpdateCommandEnabled(IDC_SHOW_BOOKMARK_BAR, show_main_ui); |
| 655 command_updater_.UpdateCommandEnabled(IDC_IMPORT_SETTINGS, show_main_ui); | 655 command_updater_.UpdateCommandEnabled(IDC_IMPORT_SETTINGS, show_main_ui); |
| 656 command_updater_.UpdateCommandEnabled(IDC_SYNC_BOOKMARKS, show_main_ui); | 656 #if defined(BROWSER_SYNC) |
| 657 command_updater_.UpdateCommandEnabled( |
| 658 IDC_SYNC_BOOKMARKS, |
| 659 show_main_ui && profile_->GetProfileSyncService() != NULL); |
| 660 #endif |
| 657 command_updater_.UpdateCommandEnabled(IDC_OPTIONS, show_main_ui); | 661 command_updater_.UpdateCommandEnabled(IDC_OPTIONS, show_main_ui); |
| 658 command_updater_.UpdateCommandEnabled(IDC_EDIT_SEARCH_ENGINES, show_main_ui); | 662 command_updater_.UpdateCommandEnabled(IDC_EDIT_SEARCH_ENGINES, show_main_ui); |
| 659 command_updater_.UpdateCommandEnabled(IDC_VIEW_PASSWORDS, show_main_ui); | 663 command_updater_.UpdateCommandEnabled(IDC_VIEW_PASSWORDS, show_main_ui); |
| 660 command_updater_.UpdateCommandEnabled(IDC_ABOUT, show_main_ui); | 664 command_updater_.UpdateCommandEnabled(IDC_ABOUT, show_main_ui); |
| 661 command_updater_.UpdateCommandEnabled(IDC_SHOW_APP_MENU, show_main_ui); | 665 command_updater_.UpdateCommandEnabled(IDC_SHOW_APP_MENU, show_main_ui); |
| 662 command_updater_.UpdateCommandEnabled(IDC_SHOW_PAGE_MENU, show_main_ui); | 666 command_updater_.UpdateCommandEnabled(IDC_SHOW_PAGE_MENU, show_main_ui); |
| 663 } | 667 } |
| 664 | 668 |
| 665 /////////////////////////////////////////////////////////////////////////////// | 669 /////////////////////////////////////////////////////////////////////////////// |
| 666 // Browser, Assorted browser commands: | 670 // Browser, Assorted browser commands: |
| (...skipping 2261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2928 /////////////////////////////////////////////////////////////////////////////// | 2932 /////////////////////////////////////////////////////////////////////////////// |
| 2929 // BrowserToolbarModel (private): | 2933 // BrowserToolbarModel (private): |
| 2930 | 2934 |
| 2931 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { | 2935 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { |
| 2932 // This |current_tab| can be NULL during the initialization of the | 2936 // This |current_tab| can be NULL during the initialization of the |
| 2933 // toolbar during window creation (i.e. before any tabs have been added | 2937 // toolbar during window creation (i.e. before any tabs have been added |
| 2934 // to the window). | 2938 // to the window). |
| 2935 TabContents* current_tab = browser_->GetSelectedTabContents(); | 2939 TabContents* current_tab = browser_->GetSelectedTabContents(); |
| 2936 return current_tab ? ¤t_tab->controller() : NULL; | 2940 return current_tab ? ¤t_tab->controller() : NULL; |
| 2937 } | 2941 } |
| OLD | NEW |