| 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/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/idle_timer.h" | 9 #include "base/idle_timer.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1110 UserMetrics::RecordAction(L"ShowDownloads", profile_); | 1110 UserMetrics::RecordAction(L"ShowDownloads", profile_); |
| 1111 ShowSingleDOMUITab(GURL(chrome::kChromeUIDownloadsURL)); | 1111 ShowSingleDOMUITab(GURL(chrome::kChromeUIDownloadsURL)); |
| 1112 } | 1112 } |
| 1113 | 1113 |
| 1114 #if defined(OS_WIN) | 1114 #if defined(OS_WIN) |
| 1115 void Browser::OpenClearBrowsingDataDialog() { | 1115 void Browser::OpenClearBrowsingDataDialog() { |
| 1116 UserMetrics::RecordAction(L"ClearBrowsingData_ShowDlg", profile_); | 1116 UserMetrics::RecordAction(L"ClearBrowsingData_ShowDlg", profile_); |
| 1117 window_->ShowClearBrowsingDataDialog(); | 1117 window_->ShowClearBrowsingDataDialog(); |
| 1118 } | 1118 } |
| 1119 | 1119 |
| 1120 void Browser::OpenImportSettingsDialog() { | |
| 1121 UserMetrics::RecordAction(L"Import_ShowDlg", profile_); | |
| 1122 window_->ShowImportDialog(); | |
| 1123 } | |
| 1124 | |
| 1125 void Browser::OpenOptionsDialog() { | 1120 void Browser::OpenOptionsDialog() { |
| 1126 UserMetrics::RecordAction(L"ShowOptions", profile_); | 1121 UserMetrics::RecordAction(L"ShowOptions", profile_); |
| 1127 ShowOptionsWindow(OPTIONS_PAGE_DEFAULT, OPTIONS_GROUP_NONE, profile_); | 1122 ShowOptionsWindow(OPTIONS_PAGE_DEFAULT, OPTIONS_GROUP_NONE, profile_); |
| 1128 } | 1123 } |
| 1129 | 1124 |
| 1130 void Browser::OpenKeywordEditor() { | 1125 void Browser::OpenKeywordEditor() { |
| 1131 UserMetrics::RecordAction(L"EditSearchEngines", profile_); | 1126 UserMetrics::RecordAction(L"EditSearchEngines", profile_); |
| 1132 window_->ShowSearchEnginesDialog(); | 1127 window_->ShowSearchEnginesDialog(); |
| 1133 } | 1128 } |
| 1134 | 1129 |
| 1135 void Browser::OpenPasswordManager() { | 1130 void Browser::OpenPasswordManager() { |
| 1136 window_->ShowPasswordManager(); | 1131 window_->ShowPasswordManager(); |
| 1137 } | 1132 } |
| 1138 #endif | 1133 #endif |
| 1139 | 1134 |
| 1135 #if defined(OS_WIN) || defined(OS_LINUX) |
| 1136 void Browser::OpenImportSettingsDialog() { |
| 1137 UserMetrics::RecordAction(L"Import_ShowDlg", profile_); |
| 1138 window_->ShowImportDialog(); |
| 1139 } |
| 1140 #endif |
| 1141 |
| 1140 void Browser::OpenAboutChromeDialog() { | 1142 void Browser::OpenAboutChromeDialog() { |
| 1141 UserMetrics::RecordAction(L"AboutChrome", profile_); | 1143 UserMetrics::RecordAction(L"AboutChrome", profile_); |
| 1142 window_->ShowAboutChromeDialog(); | 1144 window_->ShowAboutChromeDialog(); |
| 1143 } | 1145 } |
| 1144 | 1146 |
| 1145 void Browser::OpenHelpTab() { | 1147 void Browser::OpenHelpTab() { |
| 1146 GURL help_url(WideToASCII(l10n_util::GetString(IDS_HELP_CONTENT_URL))); | 1148 GURL help_url(WideToASCII(l10n_util::GetString(IDS_HELP_CONTENT_URL))); |
| 1147 AddTabWithURL(help_url, GURL(), PageTransition::AUTO_BOOKMARK, true, -1, | 1149 AddTabWithURL(help_url, GURL(), PageTransition::AUTO_BOOKMARK, true, -1, |
| 1148 false, NULL); | 1150 false, NULL); |
| 1149 } | 1151 } |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1342 case IDC_SHOW_BOOKMARK_MANAGER: OpenBookmarkManager(); break; | 1344 case IDC_SHOW_BOOKMARK_MANAGER: OpenBookmarkManager(); break; |
| 1343 #endif | 1345 #endif |
| 1344 case IDC_SHOW_HISTORY: ShowHistoryTab(); break; | 1346 case IDC_SHOW_HISTORY: ShowHistoryTab(); break; |
| 1345 case IDC_SHOW_DOWNLOADS: ShowDownloadsTab(); break; | 1347 case IDC_SHOW_DOWNLOADS: ShowDownloadsTab(); break; |
| 1346 #if defined(OS_WIN) | 1348 #if defined(OS_WIN) |
| 1347 #ifdef CHROME_PERSONALIZATION | 1349 #ifdef CHROME_PERSONALIZATION |
| 1348 case IDC_P13N_INFO: | 1350 case IDC_P13N_INFO: |
| 1349 Personalization::HandleMenuItemClick(profile()); break; | 1351 Personalization::HandleMenuItemClick(profile()); break; |
| 1350 #endif | 1352 #endif |
| 1351 case IDC_CLEAR_BROWSING_DATA: OpenClearBrowsingDataDialog(); break; | 1353 case IDC_CLEAR_BROWSING_DATA: OpenClearBrowsingDataDialog(); break; |
| 1352 case IDC_IMPORT_SETTINGS: OpenImportSettingsDialog(); break; | |
| 1353 case IDC_OPTIONS: OpenOptionsDialog(); break; | 1354 case IDC_OPTIONS: OpenOptionsDialog(); break; |
| 1354 case IDC_EDIT_SEARCH_ENGINES: OpenKeywordEditor(); break; | 1355 case IDC_EDIT_SEARCH_ENGINES: OpenKeywordEditor(); break; |
| 1355 case IDC_VIEW_PASSWORDS: OpenPasswordManager(); break; | 1356 case IDC_VIEW_PASSWORDS: OpenPasswordManager(); break; |
| 1356 #endif | 1357 #endif |
| 1358 #if defined(OS_WIN) || defined(OS_LINUX) |
| 1359 case IDC_IMPORT_SETTINGS: OpenImportSettingsDialog(); break; |
| 1360 #endif |
| 1357 case IDC_ABOUT: OpenAboutChromeDialog(); break; | 1361 case IDC_ABOUT: OpenAboutChromeDialog(); break; |
| 1358 case IDC_HELP_PAGE: OpenHelpTab(); break; | 1362 case IDC_HELP_PAGE: OpenHelpTab(); break; |
| 1359 | 1363 |
| 1360 default: | 1364 default: |
| 1361 LOG(WARNING) << "Received Unimplemented Command: " << id; | 1365 LOG(WARNING) << "Received Unimplemented Command: " << id; |
| 1362 break; | 1366 break; |
| 1363 } | 1367 } |
| 1364 } | 1368 } |
| 1365 | 1369 |
| 1366 /////////////////////////////////////////////////////////////////////////////// | 1370 /////////////////////////////////////////////////////////////////////////////// |
| (...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2621 | 2625 |
| 2622 // We need to register the window position pref. | 2626 // We need to register the window position pref. |
| 2623 std::wstring window_pref(prefs::kBrowserWindowPlacement); | 2627 std::wstring window_pref(prefs::kBrowserWindowPlacement); |
| 2624 window_pref.append(L"_"); | 2628 window_pref.append(L"_"); |
| 2625 window_pref.append(app_name); | 2629 window_pref.append(app_name); |
| 2626 PrefService* prefs = g_browser_process->local_state(); | 2630 PrefService* prefs = g_browser_process->local_state(); |
| 2627 DCHECK(prefs); | 2631 DCHECK(prefs); |
| 2628 | 2632 |
| 2629 prefs->RegisterDictionaryPref(window_pref.c_str()); | 2633 prefs->RegisterDictionaryPref(window_pref.c_str()); |
| 2630 } | 2634 } |
| OLD | NEW |