| 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" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 13 #include "base/thread.h" | 13 #include "base/thread.h" |
| 14 #include "chrome/app/chrome_dll_resource.h" | 14 #include "chrome/app/chrome_dll_resource.h" |
| 15 #include "chrome/browser/bookmarks/bookmark_model.h" | 15 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 16 #include "chrome/browser/browser_list.h" | 16 #include "chrome/browser/browser_list.h" |
| 17 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
| 18 #include "chrome/browser/browser_shutdown.h" | 18 #include "chrome/browser/browser_shutdown.h" |
| 19 #include "chrome/browser/browser_window.h" | 19 #include "chrome/browser/browser_window.h" |
| 20 #include "chrome/browser/character_encoding.h" | 20 #include "chrome/browser/character_encoding.h" |
| 21 #include "chrome/browser/debugger/devtools_manager.h" | 21 #include "chrome/browser/debugger/devtools_manager.h" |
| 22 #include "chrome/browser/download/download_item_model.h" | 22 #include "chrome/browser/download/download_item_model.h" |
| 23 #include "chrome/browser/download/download_manager.h" | 23 #include "chrome/browser/download/download_manager.h" |
| 24 #include "chrome/browser/download/download_shelf.h" | 24 #include "chrome/browser/download/download_shelf.h" |
| 25 #include "chrome/browser/download/download_started_animation.h" | 25 #include "chrome/browser/download/download_started_animation.h" |
| 26 #include "chrome/browser/find_bar.h" | 26 #include "chrome/browser/find_bar.h" |
| 27 #include "chrome/browser/find_bar_controller.h" | 27 #include "chrome/browser/find_bar_controller.h" |
| 28 #include "chrome/browser/google_url_tracker.h" |
| 28 #include "chrome/browser/location_bar.h" | 29 #include "chrome/browser/location_bar.h" |
| 29 #include "chrome/browser/metrics/user_metrics.h" | 30 #include "chrome/browser/metrics/user_metrics.h" |
| 30 #include "chrome/browser/net/url_fixer_upper.h" | 31 #include "chrome/browser/net/url_fixer_upper.h" |
| 31 #include "chrome/browser/options_window.h" | 32 #include "chrome/browser/options_window.h" |
| 32 #include "chrome/browser/profile.h" | 33 #include "chrome/browser/profile.h" |
| 33 #include "chrome/browser/renderer_host/site_instance.h" | 34 #include "chrome/browser/renderer_host/site_instance.h" |
| 34 #include "chrome/browser/sessions/session_service.h" | 35 #include "chrome/browser/sessions/session_service.h" |
| 35 #include "chrome/browser/sessions/session_types.h" | 36 #include "chrome/browser/sessions/session_types.h" |
| 36 #include "chrome/browser/sessions/tab_restore_service.h" | 37 #include "chrome/browser/sessions/tab_restore_service.h" |
| 37 #include "chrome/browser/status_bubble.h" | 38 #include "chrome/browser/status_bubble.h" |
| (...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1173 void Browser::ShowControlPanel() { | 1174 void Browser::ShowControlPanel() { |
| 1174 GURL url("http://localhost:8080"); | 1175 GURL url("http://localhost:8080"); |
| 1175 AddTabWithURL(url, GURL(), PageTransition::AUTO_BOOKMARK, true, -1, | 1176 AddTabWithURL(url, GURL(), PageTransition::AUTO_BOOKMARK, true, -1, |
| 1176 false, NULL); | 1177 false, NULL); |
| 1177 } | 1178 } |
| 1178 #endif | 1179 #endif |
| 1179 | 1180 |
| 1180 /////////////////////////////////////////////////////////////////////////////// | 1181 /////////////////////////////////////////////////////////////////////////////// |
| 1181 | 1182 |
| 1182 // static | 1183 // static |
| 1184 void Browser::SetNewHomePagePrefs(PrefService* prefs) { |
| 1185 prefs->SetString(prefs::kHomePage, |
| 1186 ASCIIToWide(GoogleURLTracker::kDefaultGoogleHomepage)); |
| 1187 prefs->SetBoolean(prefs::kHomePageIsNewTabPage, false); |
| 1188 prefs->SetBoolean(prefs::kShowHomeButton, true); |
| 1189 } |
| 1190 |
| 1191 // static |
| 1183 void Browser::RegisterPrefs(PrefService* prefs) { | 1192 void Browser::RegisterPrefs(PrefService* prefs) { |
| 1184 prefs->RegisterDictionaryPref(prefs::kBrowserWindowPlacement); | 1193 prefs->RegisterDictionaryPref(prefs::kBrowserWindowPlacement); |
| 1185 prefs->RegisterIntegerPref(prefs::kOptionsWindowLastTabIndex, 0); | 1194 prefs->RegisterIntegerPref(prefs::kOptionsWindowLastTabIndex, 0); |
| 1186 prefs->RegisterIntegerPref(prefs::kDevToolsSplitLocation, -1); | 1195 prefs->RegisterIntegerPref(prefs::kDevToolsSplitLocation, -1); |
| 1187 } | 1196 } |
| 1188 | 1197 |
| 1189 // static | 1198 // static |
| 1190 void Browser::RegisterUserPrefs(PrefService* prefs) { | 1199 void Browser::RegisterUserPrefs(PrefService* prefs) { |
| 1191 prefs->RegisterStringPref(prefs::kHomePage, L"chrome-internal:"); | 1200 prefs->RegisterStringPref(prefs::kHomePage, L"chrome-internal:"); |
| 1192 prefs->RegisterBooleanPref(prefs::kHomePageIsNewTabPage, true); | 1201 prefs->RegisterBooleanPref(prefs::kHomePageIsNewTabPage, true); |
| (...skipping 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2774 /////////////////////////////////////////////////////////////////////////////// | 2783 /////////////////////////////////////////////////////////////////////////////// |
| 2775 // BrowserToolbarModel (private): | 2784 // BrowserToolbarModel (private): |
| 2776 | 2785 |
| 2777 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { | 2786 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { |
| 2778 // This |current_tab| can be NULL during the initialization of the | 2787 // This |current_tab| can be NULL during the initialization of the |
| 2779 // toolbar during window creation (i.e. before any tabs have been added | 2788 // toolbar during window creation (i.e. before any tabs have been added |
| 2780 // to the window). | 2789 // to the window). |
| 2781 TabContents* current_tab = browser_->GetSelectedTabContents(); | 2790 TabContents* current_tab = browser_->GetSelectedTabContents(); |
| 2782 return current_tab ? ¤t_tab->controller() : NULL; | 2791 return current_tab ? ¤t_tab->controller() : NULL; |
| 2783 } | 2792 } |
| OLD | NEW |