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/animation.h" | 7 #include "app/animation.h" |
8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/idle_timer.h" | 10 #include "base/idle_timer.h" |
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 UserMetrics::RecordAction(L"AboutChrome", profile_); | 1155 UserMetrics::RecordAction(L"AboutChrome", profile_); |
1156 window_->ShowAboutChromeDialog(); | 1156 window_->ShowAboutChromeDialog(); |
1157 } | 1157 } |
1158 | 1158 |
1159 void Browser::OpenHelpTab() { | 1159 void Browser::OpenHelpTab() { |
1160 GURL help_url(WideToASCII(l10n_util::GetString(IDS_HELP_CONTENT_URL))); | 1160 GURL help_url(WideToASCII(l10n_util::GetString(IDS_HELP_CONTENT_URL))); |
1161 AddTabWithURL(help_url, GURL(), PageTransition::AUTO_BOOKMARK, true, -1, | 1161 AddTabWithURL(help_url, GURL(), PageTransition::AUTO_BOOKMARK, true, -1, |
1162 false, NULL); | 1162 false, NULL); |
1163 } | 1163 } |
1164 | 1164 |
| 1165 #if defined(LINUX2) |
| 1166 void Browser::ShowControlPanel() { |
| 1167 GURL url("http://localhost:8080"); |
| 1168 AddTabWithURL(url, GURL(), PageTransition::AUTO_BOOKMARK, true, -1, |
| 1169 false, NULL); |
| 1170 } |
| 1171 #endif |
| 1172 |
1165 /////////////////////////////////////////////////////////////////////////////// | 1173 /////////////////////////////////////////////////////////////////////////////// |
1166 | 1174 |
1167 // static | 1175 // static |
1168 void Browser::RegisterPrefs(PrefService* prefs) { | 1176 void Browser::RegisterPrefs(PrefService* prefs) { |
1169 prefs->RegisterDictionaryPref(prefs::kBrowserWindowPlacement); | 1177 prefs->RegisterDictionaryPref(prefs::kBrowserWindowPlacement); |
1170 prefs->RegisterIntegerPref(prefs::kOptionsWindowLastTabIndex, 0); | 1178 prefs->RegisterIntegerPref(prefs::kOptionsWindowLastTabIndex, 0); |
1171 } | 1179 } |
1172 | 1180 |
1173 // static | 1181 // static |
1174 void Browser::RegisterUserPrefs(PrefService* prefs) { | 1182 void Browser::RegisterUserPrefs(PrefService* prefs) { |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1355 Personalization::HandleMenuItemClick(profile()); break; | 1363 Personalization::HandleMenuItemClick(profile()); break; |
1356 #endif | 1364 #endif |
1357 #endif | 1365 #endif |
1358 case IDC_OPTIONS: OpenOptionsDialog(); break; | 1366 case IDC_OPTIONS: OpenOptionsDialog(); break; |
1359 case IDC_EDIT_SEARCH_ENGINES: OpenKeywordEditor(); break; | 1367 case IDC_EDIT_SEARCH_ENGINES: OpenKeywordEditor(); break; |
1360 case IDC_VIEW_PASSWORDS: OpenPasswordManager(); break; | 1368 case IDC_VIEW_PASSWORDS: OpenPasswordManager(); break; |
1361 case IDC_CLEAR_BROWSING_DATA: OpenClearBrowsingDataDialog(); break; | 1369 case IDC_CLEAR_BROWSING_DATA: OpenClearBrowsingDataDialog(); break; |
1362 case IDC_IMPORT_SETTINGS: OpenImportSettingsDialog(); break; | 1370 case IDC_IMPORT_SETTINGS: OpenImportSettingsDialog(); break; |
1363 case IDC_ABOUT: OpenAboutChromeDialog(); break; | 1371 case IDC_ABOUT: OpenAboutChromeDialog(); break; |
1364 case IDC_HELP_PAGE: OpenHelpTab(); break; | 1372 case IDC_HELP_PAGE: OpenHelpTab(); break; |
| 1373 #if defined(LINUX2) |
| 1374 case IDC_CONTROL_PANEL: ShowControlPanel(); break; |
| 1375 #endif |
1365 | 1376 |
1366 default: | 1377 default: |
1367 LOG(WARNING) << "Received Unimplemented Command: " << id; | 1378 LOG(WARNING) << "Received Unimplemented Command: " << id; |
1368 break; | 1379 break; |
1369 } | 1380 } |
1370 } | 1381 } |
1371 | 1382 |
1372 /////////////////////////////////////////////////////////////////////////////// | 1383 /////////////////////////////////////////////////////////////////////////////// |
1373 // Browser, CommandUpdater::CommandUpdaterDelegate implementation: | 1384 // Browser, CommandUpdater::CommandUpdaterDelegate implementation: |
1374 | 1385 |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2092 // Show various bits of UI | 2103 // Show various bits of UI |
2093 command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, true); | 2104 command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, true); |
2094 command_updater_.UpdateCommandEnabled(IDC_CREATE_SHORTCUTS, false); | 2105 command_updater_.UpdateCommandEnabled(IDC_CREATE_SHORTCUTS, false); |
2095 command_updater_.UpdateCommandEnabled(IDC_JS_CONSOLE, true); | 2106 command_updater_.UpdateCommandEnabled(IDC_JS_CONSOLE, true); |
2096 command_updater_.UpdateCommandEnabled(IDC_TASK_MANAGER, true); | 2107 command_updater_.UpdateCommandEnabled(IDC_TASK_MANAGER, true); |
2097 command_updater_.UpdateCommandEnabled(IDC_SELECT_PROFILE, true); | 2108 command_updater_.UpdateCommandEnabled(IDC_SELECT_PROFILE, true); |
2098 command_updater_.UpdateCommandEnabled(IDC_SHOW_HISTORY, true); | 2109 command_updater_.UpdateCommandEnabled(IDC_SHOW_HISTORY, true); |
2099 command_updater_.UpdateCommandEnabled(IDC_SHOW_BOOKMARK_MANAGER, true); | 2110 command_updater_.UpdateCommandEnabled(IDC_SHOW_BOOKMARK_MANAGER, true); |
2100 command_updater_.UpdateCommandEnabled(IDC_SHOW_DOWNLOADS, true); | 2111 command_updater_.UpdateCommandEnabled(IDC_SHOW_DOWNLOADS, true); |
2101 command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE, true); | 2112 command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE, true); |
| 2113 #if defined(LINUX2) |
| 2114 command_updater_.UpdateCommandEnabled(IDC_CONTROL_PANEL, true); |
| 2115 #endif |
2102 | 2116 |
2103 // Initialize other commands based on the window type. | 2117 // Initialize other commands based on the window type. |
2104 { | 2118 { |
2105 bool normal_window = type() == TYPE_NORMAL; | 2119 bool normal_window = type() == TYPE_NORMAL; |
2106 | 2120 |
2107 // Navigation commands | 2121 // Navigation commands |
2108 command_updater_.UpdateCommandEnabled(IDC_HOME, normal_window); | 2122 command_updater_.UpdateCommandEnabled(IDC_HOME, normal_window); |
2109 | 2123 |
2110 // Window management commands | 2124 // Window management commands |
2111 command_updater_.UpdateCommandEnabled(IDC_SELECT_NEXT_TAB, normal_window); | 2125 command_updater_.UpdateCommandEnabled(IDC_SELECT_NEXT_TAB, normal_window); |
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2705 /////////////////////////////////////////////////////////////////////////////// | 2719 /////////////////////////////////////////////////////////////////////////////// |
2706 // BrowserToolbarModel (private): | 2720 // BrowserToolbarModel (private): |
2707 | 2721 |
2708 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { | 2722 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { |
2709 // This |current_tab| can be NULL during the initialization of the | 2723 // This |current_tab| can be NULL during the initialization of the |
2710 // toolbar during window creation (i.e. before any tabs have been added | 2724 // toolbar during window creation (i.e. before any tabs have been added |
2711 // to the window). | 2725 // to the window). |
2712 TabContents* current_tab = browser_->GetSelectedTabContents(); | 2726 TabContents* current_tab = browser_->GetSelectedTabContents(); |
2713 return current_tab ? ¤t_tab->controller() : NULL; | 2727 return current_tab ? ¤t_tab->controller() : NULL; |
2714 } | 2728 } |
OLD | NEW |