| 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 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1275 GURL url("http://localhost:8080"); | 1275 GURL url("http://localhost:8080"); |
| 1276 AddTabWithURL(url, GURL(), PageTransition::AUTO_BOOKMARK, true, -1, | 1276 AddTabWithURL(url, GURL(), PageTransition::AUTO_BOOKMARK, true, -1, |
| 1277 false, NULL); | 1277 false, NULL); |
| 1278 } | 1278 } |
| 1279 #endif | 1279 #endif |
| 1280 | 1280 |
| 1281 /////////////////////////////////////////////////////////////////////////////// | 1281 /////////////////////////////////////////////////////////////////////////////// |
| 1282 | 1282 |
| 1283 // static | 1283 // static |
| 1284 void Browser::SetNewHomePagePrefs(PrefService* prefs) { | 1284 void Browser::SetNewHomePagePrefs(PrefService* prefs) { |
| 1285 prefs->SetString(prefs::kHomePage, | 1285 if (!prefs->HasPrefPath(prefs::kHomePage)) |
| 1286 ASCIIToWide(GoogleURLTracker::kDefaultGoogleHomepage)); | 1286 prefs->SetString(prefs::kHomePage, |
| 1287 prefs->SetBoolean(prefs::kHomePageIsNewTabPage, false); | 1287 ASCIIToWide(GoogleURLTracker::kDefaultGoogleHomepage)); |
| 1288 prefs->SetBoolean(prefs::kShowHomeButton, true); | 1288 if (!prefs->HasPrefPath(prefs::kHomePageIsNewTabPage)) |
| 1289 prefs->SetBoolean(prefs::kHomePageIsNewTabPage, false); |
| 1290 if (!prefs->HasPrefPath(prefs::kShowHomeButton)) |
| 1291 prefs->SetBoolean(prefs::kShowHomeButton, true); |
| 1289 } | 1292 } |
| 1290 | 1293 |
| 1291 // static | 1294 // static |
| 1292 void Browser::RegisterPrefs(PrefService* prefs) { | 1295 void Browser::RegisterPrefs(PrefService* prefs) { |
| 1293 prefs->RegisterDictionaryPref(prefs::kBrowserWindowPlacement); | 1296 prefs->RegisterDictionaryPref(prefs::kBrowserWindowPlacement); |
| 1294 prefs->RegisterIntegerPref(prefs::kOptionsWindowLastTabIndex, 0); | 1297 prefs->RegisterIntegerPref(prefs::kOptionsWindowLastTabIndex, 0); |
| 1295 prefs->RegisterIntegerPref(prefs::kDevToolsSplitLocation, -1); | 1298 prefs->RegisterIntegerPref(prefs::kDevToolsSplitLocation, -1); |
| 1296 } | 1299 } |
| 1297 | 1300 |
| 1298 // static | 1301 // static |
| (...skipping 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2969 /////////////////////////////////////////////////////////////////////////////// | 2972 /////////////////////////////////////////////////////////////////////////////// |
| 2970 // BrowserToolbarModel (private): | 2973 // BrowserToolbarModel (private): |
| 2971 | 2974 |
| 2972 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { | 2975 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { |
| 2973 // This |current_tab| can be NULL during the initialization of the | 2976 // This |current_tab| can be NULL during the initialization of the |
| 2974 // toolbar during window creation (i.e. before any tabs have been added | 2977 // toolbar during window creation (i.e. before any tabs have been added |
| 2975 // to the window). | 2978 // to the window). |
| 2976 TabContents* current_tab = browser_->GetSelectedTabContents(); | 2979 TabContents* current_tab = browser_->GetSelectedTabContents(); |
| 2977 return current_tab ? ¤t_tab->controller() : NULL; | 2980 return current_tab ? ¤t_tab->controller() : NULL; |
| 2978 } | 2981 } |
| OLD | NEW |