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