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 2445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2456 case IDC_ABOUT: OpenAboutChromeDialog(); break; | 2456 case IDC_ABOUT: OpenAboutChromeDialog(); break; |
2457 case IDC_UPGRADE_DIALOG: OpenUpdateChromeDialog(); break; | 2457 case IDC_UPGRADE_DIALOG: OpenUpdateChromeDialog(); break; |
2458 case IDC_VIEW_INCOMPATIBILITIES: ShowAboutConflictsTab(); break; | 2458 case IDC_VIEW_INCOMPATIBILITIES: ShowAboutConflictsTab(); break; |
2459 case IDC_HELP_PAGE: ShowHelpTab(); break; | 2459 case IDC_HELP_PAGE: ShowHelpTab(); break; |
2460 #if defined(OS_CHROMEOS) | 2460 #if defined(OS_CHROMEOS) |
2461 case IDC_FILE_MANAGER: OpenFileManager(); break; | 2461 case IDC_FILE_MANAGER: OpenFileManager(); break; |
2462 case IDC_SYSTEM_OPTIONS: OpenSystemOptionsDialog(); break; | 2462 case IDC_SYSTEM_OPTIONS: OpenSystemOptionsDialog(); break; |
2463 case IDC_INTERNET_OPTIONS: OpenInternetOptionsDialog(); break; | 2463 case IDC_INTERNET_OPTIONS: OpenInternetOptionsDialog(); break; |
2464 case IDC_LANGUAGE_OPTIONS: OpenLanguageOptionsDialog(); break; | 2464 case IDC_LANGUAGE_OPTIONS: OpenLanguageOptionsDialog(); break; |
2465 #endif | 2465 #endif |
| 2466 case IDC_SHOW_SYNC_SETUP: ShowSyncSetup(); break; |
2466 | 2467 |
2467 default: | 2468 default: |
2468 LOG(WARNING) << "Received Unimplemented Command: " << id; | 2469 LOG(WARNING) << "Received Unimplemented Command: " << id; |
2469 break; | 2470 break; |
2470 } | 2471 } |
2471 } | 2472 } |
2472 | 2473 |
2473 bool Browser::ExecuteCommandIfEnabled(int id) { | 2474 bool Browser::ExecuteCommandIfEnabled(int id) { |
2474 if (command_updater_.SupportsCommand(id) && | 2475 if (command_updater_.SupportsCommand(id) && |
2475 command_updater_.IsCommandEnabled(id)) { | 2476 command_updater_.IsCommandEnabled(id)) { |
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3855 command_updater_.UpdateCommandEnabled(IDC_IMPORT_SETTINGS, true); | 3856 command_updater_.UpdateCommandEnabled(IDC_IMPORT_SETTINGS, true); |
3856 command_updater_.UpdateCommandEnabled(IDC_BOOKMARKS_MENU, true); | 3857 command_updater_.UpdateCommandEnabled(IDC_BOOKMARKS_MENU, true); |
3857 | 3858 |
3858 #if defined(OS_CHROMEOS) | 3859 #if defined(OS_CHROMEOS) |
3859 command_updater_.UpdateCommandEnabled(IDC_FILE_MANAGER, true); | 3860 command_updater_.UpdateCommandEnabled(IDC_FILE_MANAGER, true); |
3860 command_updater_.UpdateCommandEnabled(IDC_SEARCH, true); | 3861 command_updater_.UpdateCommandEnabled(IDC_SEARCH, true); |
3861 command_updater_.UpdateCommandEnabled(IDC_SHOW_KEYBOARD_OVERLAY, true); | 3862 command_updater_.UpdateCommandEnabled(IDC_SHOW_KEYBOARD_OVERLAY, true); |
3862 command_updater_.UpdateCommandEnabled(IDC_SYSTEM_OPTIONS, true); | 3863 command_updater_.UpdateCommandEnabled(IDC_SYSTEM_OPTIONS, true); |
3863 command_updater_.UpdateCommandEnabled(IDC_INTERNET_OPTIONS, true); | 3864 command_updater_.UpdateCommandEnabled(IDC_INTERNET_OPTIONS, true); |
3864 #endif | 3865 #endif |
| 3866 command_updater_.UpdateCommandEnabled(IDC_SHOW_SYNC_SETUP, true); |
3865 | 3867 |
3866 ExtensionService* extension_service = profile()->GetExtensionService(); | 3868 ExtensionService* extension_service = profile()->GetExtensionService(); |
3867 bool enable_extensions = | 3869 bool enable_extensions = |
3868 extension_service && extension_service->extensions_enabled(); | 3870 extension_service && extension_service->extensions_enabled(); |
3869 command_updater_.UpdateCommandEnabled(IDC_MANAGE_EXTENSIONS, | 3871 command_updater_.UpdateCommandEnabled(IDC_MANAGE_EXTENSIONS, |
3870 enable_extensions); | 3872 enable_extensions); |
3871 | 3873 |
3872 // Initialize other commands based on the window type. | 3874 // Initialize other commands based on the window type. |
3873 bool normal_window = is_type_tabbed(); | 3875 bool normal_window = is_type_tabbed(); |
3874 | 3876 |
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4747 // end up querying state once they process the tab switch. | 4749 // end up querying state once they process the tab switch. |
4748 return; | 4750 return; |
4749 } | 4751 } |
4750 | 4752 |
4751 BookmarkBar::AnimateChangeType animate_type = | 4753 BookmarkBar::AnimateChangeType animate_type = |
4752 (reason == BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE) ? | 4754 (reason == BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE) ? |
4753 BookmarkBar::ANIMATE_STATE_CHANGE : | 4755 BookmarkBar::ANIMATE_STATE_CHANGE : |
4754 BookmarkBar::DONT_ANIMATE_STATE_CHANGE; | 4756 BookmarkBar::DONT_ANIMATE_STATE_CHANGE; |
4755 window_->BookmarkBarStateChanged(animate_type); | 4757 window_->BookmarkBarStateChanged(animate_type); |
4756 } | 4758 } |
| 4759 |
| 4760 void Browser::ShowSyncSetup() { |
| 4761 ProfileSyncService* service = profile()->GetProfileSyncService(); |
| 4762 if (service->HasSyncSetupCompleted()) |
| 4763 ShowOptionsTab(chrome::kSyncSetupSubPage); |
| 4764 else |
| 4765 profile()->GetProfileSyncService()->ShowLoginDialog(); |
| 4766 } |
OLD | NEW |