OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 #include <windows.h> | 9 #include <windows.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 2150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2161 case IDC_MANAGE_EXTENSIONS: ShowExtensionsTab(); break; | 2161 case IDC_MANAGE_EXTENSIONS: ShowExtensionsTab(); break; |
2162 case IDC_SYNC_BOOKMARKS: OpenSyncMyBookmarksDialog(); break; | 2162 case IDC_SYNC_BOOKMARKS: OpenSyncMyBookmarksDialog(); break; |
2163 #if defined(ENABLE_REMOTING) | 2163 #if defined(ENABLE_REMOTING) |
2164 case IDC_REMOTING_SETUP: OpenRemotingSetupDialog(); break; | 2164 case IDC_REMOTING_SETUP: OpenRemotingSetupDialog(); break; |
2165 #endif | 2165 #endif |
2166 case IDC_OPTIONS: OpenOptionsDialog(); break; | 2166 case IDC_OPTIONS: OpenOptionsDialog(); break; |
2167 case IDC_EDIT_SEARCH_ENGINES: OpenKeywordEditor(); break; | 2167 case IDC_EDIT_SEARCH_ENGINES: OpenKeywordEditor(); break; |
2168 case IDC_VIEW_PASSWORDS: OpenPasswordManager(); break; | 2168 case IDC_VIEW_PASSWORDS: OpenPasswordManager(); break; |
2169 case IDC_CLEAR_BROWSING_DATA: OpenClearBrowsingDataDialog(); break; | 2169 case IDC_CLEAR_BROWSING_DATA: OpenClearBrowsingDataDialog(); break; |
2170 case IDC_IMPORT_SETTINGS: OpenImportSettingsDialog(); break; | 2170 case IDC_IMPORT_SETTINGS: OpenImportSettingsDialog(); break; |
2171 case IDC_ABOUT: | 2171 case IDC_ABOUT: OpenAboutChromeDialog(); break; |
2172 if (Singleton<UpgradeDetector>::get()->notify_upgrade()) | 2172 case IDC_UPGRADE_DIALOG: OpenUpdateChromeDialog(); break; |
2173 OpenUpdateChromeDialog(); | |
2174 else | |
2175 OpenAboutChromeDialog(); | |
2176 break; | |
2177 case IDC_HELP_PAGE: OpenHelpTab(); break; | 2173 case IDC_HELP_PAGE: OpenHelpTab(); break; |
2178 #if defined(OS_CHROMEOS) | 2174 #if defined(OS_CHROMEOS) |
2179 case IDC_SYSTEM_OPTIONS: OpenSystemOptionsDialog(); break; | 2175 case IDC_SYSTEM_OPTIONS: OpenSystemOptionsDialog(); break; |
2180 case IDC_INTERNET_OPTIONS: OpenInternetOptionsDialog(); break; | 2176 case IDC_INTERNET_OPTIONS: OpenInternetOptionsDialog(); break; |
2181 case IDC_LANGUAGE_OPTIONS: OpenLanguageOptionsDialog(); break; | 2177 case IDC_LANGUAGE_OPTIONS: OpenLanguageOptionsDialog(); break; |
2182 #endif | 2178 #endif |
2183 | 2179 |
2184 default: | 2180 default: |
2185 LOG(WARNING) << "Received Unimplemented Command: " << id; | 2181 LOG(WARNING) << "Received Unimplemented Command: " << id; |
2186 break; | 2182 break; |
(...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3318 command_updater_.UpdateCommandEnabled(IDC_FIND_NEXT, non_devtools_window); | 3314 command_updater_.UpdateCommandEnabled(IDC_FIND_NEXT, non_devtools_window); |
3319 command_updater_.UpdateCommandEnabled(IDC_FIND_PREVIOUS, non_devtools_window); | 3315 command_updater_.UpdateCommandEnabled(IDC_FIND_PREVIOUS, non_devtools_window); |
3320 | 3316 |
3321 // AutoFill | 3317 // AutoFill |
3322 command_updater_.UpdateCommandEnabled(IDC_AUTOFILL_DEFAULT, | 3318 command_updater_.UpdateCommandEnabled(IDC_AUTOFILL_DEFAULT, |
3323 non_devtools_window); | 3319 non_devtools_window); |
3324 | 3320 |
3325 // Show various bits of UI | 3321 // Show various bits of UI |
3326 command_updater_.UpdateCommandEnabled(IDC_CLEAR_BROWSING_DATA, normal_window); | 3322 command_updater_.UpdateCommandEnabled(IDC_CLEAR_BROWSING_DATA, normal_window); |
3327 | 3323 |
| 3324 // The upgrade entry should always be enabled. Whether it is visible is a |
| 3325 // separate matter determined on menu show. |
| 3326 command_updater_.UpdateCommandEnabled(IDC_UPGRADE_DIALOG, true); |
| 3327 |
3328 // Initialize other commands whose state changes based on fullscreen mode. | 3328 // Initialize other commands whose state changes based on fullscreen mode. |
3329 UpdateCommandsForFullscreenMode(false); | 3329 UpdateCommandsForFullscreenMode(false); |
3330 } | 3330 } |
3331 | 3331 |
3332 void Browser::UpdateCommandsForTabState() { | 3332 void Browser::UpdateCommandsForTabState() { |
3333 TabContents* current_tab = GetSelectedTabContents(); | 3333 TabContents* current_tab = GetSelectedTabContents(); |
3334 if (!current_tab) // May be NULL during tab restore. | 3334 if (!current_tab) // May be NULL during tab restore. |
3335 return; | 3335 return; |
3336 | 3336 |
3337 // Navigation commands | 3337 // Navigation commands |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4016 } | 4016 } |
4017 | 4017 |
4018 void Browser::TabRestoreServiceDestroyed(TabRestoreService* service) { | 4018 void Browser::TabRestoreServiceDestroyed(TabRestoreService* service) { |
4019 if (!tab_restore_service_) | 4019 if (!tab_restore_service_) |
4020 return; | 4020 return; |
4021 | 4021 |
4022 DCHECK_EQ(tab_restore_service_, service); | 4022 DCHECK_EQ(tab_restore_service_, service); |
4023 tab_restore_service_->RemoveObserver(this); | 4023 tab_restore_service_->RemoveObserver(this); |
4024 tab_restore_service_ = NULL; | 4024 tab_restore_service_ = NULL; |
4025 } | 4025 } |
OLD | NEW |