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 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1128 void Browser::OpenKeywordEditor() { | 1128 void Browser::OpenKeywordEditor() { |
1129 UserMetrics::RecordAction(L"EditSearchEngines", profile_); | 1129 UserMetrics::RecordAction(L"EditSearchEngines", profile_); |
1130 window_->ShowSearchEnginesDialog(); | 1130 window_->ShowSearchEnginesDialog(); |
1131 } | 1131 } |
1132 | 1132 |
1133 void Browser::OpenPasswordManager() { | 1133 void Browser::OpenPasswordManager() { |
1134 window_->ShowPasswordManager(); | 1134 window_->ShowPasswordManager(); |
1135 } | 1135 } |
1136 #endif | 1136 #endif |
1137 | 1137 |
1138 #if defined(OS_WIN) || defined(OS_LINUX) | |
1139 void Browser::OpenImportSettingsDialog() { | 1138 void Browser::OpenImportSettingsDialog() { |
1140 UserMetrics::RecordAction(L"Import_ShowDlg", profile_); | 1139 UserMetrics::RecordAction(L"Import_ShowDlg", profile_); |
1141 window_->ShowImportDialog(); | 1140 window_->ShowImportDialog(); |
1142 } | 1141 } |
1143 #endif | |
1144 | 1142 |
1145 void Browser::OpenAboutChromeDialog() { | 1143 void Browser::OpenAboutChromeDialog() { |
1146 UserMetrics::RecordAction(L"AboutChrome", profile_); | 1144 UserMetrics::RecordAction(L"AboutChrome", profile_); |
1147 window_->ShowAboutChromeDialog(); | 1145 window_->ShowAboutChromeDialog(); |
1148 } | 1146 } |
1149 | 1147 |
1150 void Browser::OpenHelpTab() { | 1148 void Browser::OpenHelpTab() { |
1151 GURL help_url(WideToASCII(l10n_util::GetString(IDS_HELP_CONTENT_URL))); | 1149 GURL help_url(WideToASCII(l10n_util::GetString(IDS_HELP_CONTENT_URL))); |
1152 AddTabWithURL(help_url, GURL(), PageTransition::AUTO_BOOKMARK, true, -1, | 1150 AddTabWithURL(help_url, GURL(), PageTransition::AUTO_BOOKMARK, true, -1, |
1153 false, NULL); | 1151 false, NULL); |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1352 #ifdef CHROME_PERSONALIZATION | 1350 #ifdef CHROME_PERSONALIZATION |
1353 case IDC_P13N_INFO: | 1351 case IDC_P13N_INFO: |
1354 Personalization::HandleMenuItemClick(profile()); break; | 1352 Personalization::HandleMenuItemClick(profile()); break; |
1355 #endif | 1353 #endif |
1356 #endif | 1354 #endif |
1357 case IDC_OPTIONS: OpenOptionsDialog(); break; | 1355 case IDC_OPTIONS: OpenOptionsDialog(); break; |
1358 #if defined(OS_WIN) | 1356 #if defined(OS_WIN) |
1359 case IDC_EDIT_SEARCH_ENGINES: OpenKeywordEditor(); break; | 1357 case IDC_EDIT_SEARCH_ENGINES: OpenKeywordEditor(); break; |
1360 case IDC_VIEW_PASSWORDS: OpenPasswordManager(); break; | 1358 case IDC_VIEW_PASSWORDS: OpenPasswordManager(); break; |
1361 #endif | 1359 #endif |
1362 #if defined(OS_WIN) || defined(OS_LINUX) | |
1363 case IDC_CLEAR_BROWSING_DATA: OpenClearBrowsingDataDialog(); break; | 1360 case IDC_CLEAR_BROWSING_DATA: OpenClearBrowsingDataDialog(); break; |
1364 case IDC_IMPORT_SETTINGS: OpenImportSettingsDialog(); break; | 1361 case IDC_IMPORT_SETTINGS: OpenImportSettingsDialog(); break; |
1365 #endif | |
1366 case IDC_ABOUT: OpenAboutChromeDialog(); break; | 1362 case IDC_ABOUT: OpenAboutChromeDialog(); break; |
1367 case IDC_HELP_PAGE: OpenHelpTab(); break; | 1363 case IDC_HELP_PAGE: OpenHelpTab(); break; |
1368 | 1364 |
1369 default: | 1365 default: |
1370 LOG(WARNING) << "Received Unimplemented Command: " << id; | 1366 LOG(WARNING) << "Received Unimplemented Command: " << id; |
1371 break; | 1367 break; |
1372 } | 1368 } |
1373 } | 1369 } |
1374 | 1370 |
1375 /////////////////////////////////////////////////////////////////////////////// | 1371 /////////////////////////////////////////////////////////////////////////////// |
(...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2644 | 2640 |
2645 // We need to register the window position pref. | 2641 // We need to register the window position pref. |
2646 std::wstring window_pref(prefs::kBrowserWindowPlacement); | 2642 std::wstring window_pref(prefs::kBrowserWindowPlacement); |
2647 window_pref.append(L"_"); | 2643 window_pref.append(L"_"); |
2648 window_pref.append(app_name); | 2644 window_pref.append(app_name); |
2649 PrefService* prefs = g_browser_process->local_state(); | 2645 PrefService* prefs = g_browser_process->local_state(); |
2650 DCHECK(prefs); | 2646 DCHECK(prefs); |
2651 | 2647 |
2652 prefs->RegisterDictionaryPref(window_pref.c_str()); | 2648 prefs->RegisterDictionaryPref(window_pref.c_str()); |
2653 } | 2649 } |
OLD | NEW |