Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: chrome/browser/browser.cc

Issue 174030: Change default homepage experience. (Closed)
Patch Set: Update so only new users see this Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/browser.h ('k') | chrome/browser/browser_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/keyboard_codes.h" 11 #include "base/keyboard_codes.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/string_util.h" 13 #include "base/string_util.h"
14 #include "base/thread.h" 14 #include "base/thread.h"
15 #include "chrome/app/chrome_dll_resource.h" 15 #include "chrome/app/chrome_dll_resource.h"
16 #include "chrome/browser/bookmarks/bookmark_model.h" 16 #include "chrome/browser/bookmarks/bookmark_model.h"
17 #include "chrome/browser/browser_list.h" 17 #include "chrome/browser/browser_list.h"
18 #include "chrome/browser/browser_process.h" 18 #include "chrome/browser/browser_process.h"
19 #include "chrome/browser/browser_shutdown.h" 19 #include "chrome/browser/browser_shutdown.h"
20 #include "chrome/browser/browser_window.h" 20 #include "chrome/browser/browser_window.h"
21 #include "chrome/browser/character_encoding.h" 21 #include "chrome/browser/character_encoding.h"
22 #include "chrome/browser/debugger/devtools_manager.h" 22 #include "chrome/browser/debugger/devtools_manager.h"
23 #include "chrome/browser/download/download_item_model.h" 23 #include "chrome/browser/download/download_item_model.h"
24 #include "chrome/browser/download/download_manager.h" 24 #include "chrome/browser/download/download_manager.h"
25 #include "chrome/browser/download/download_shelf.h" 25 #include "chrome/browser/download/download_shelf.h"
26 #include "chrome/browser/download/download_started_animation.h" 26 #include "chrome/browser/download/download_started_animation.h"
27 #include "chrome/browser/extensions/extension_disabled_infobar_delegate.h" 27 #include "chrome/browser/extensions/extension_disabled_infobar_delegate.h"
28 #include "chrome/browser/find_bar.h" 28 #include "chrome/browser/find_bar.h"
29 #include "chrome/browser/find_bar_controller.h" 29 #include "chrome/browser/find_bar_controller.h"
30 #include "chrome/browser/google_url_tracker.h"
30 #include "chrome/browser/location_bar.h" 31 #include "chrome/browser/location_bar.h"
31 #include "chrome/browser/metrics/user_metrics.h" 32 #include "chrome/browser/metrics/user_metrics.h"
32 #include "chrome/browser/net/url_fixer_upper.h" 33 #include "chrome/browser/net/url_fixer_upper.h"
33 #include "chrome/browser/options_window.h" 34 #include "chrome/browser/options_window.h"
34 #include "chrome/browser/profile.h" 35 #include "chrome/browser/profile.h"
35 #include "chrome/browser/renderer_host/site_instance.h" 36 #include "chrome/browser/renderer_host/site_instance.h"
36 #include "chrome/browser/sessions/session_service.h" 37 #include "chrome/browser/sessions/session_service.h"
37 #include "chrome/browser/sessions/session_types.h" 38 #include "chrome/browser/sessions/session_types.h"
38 #include "chrome/browser/sessions/tab_restore_service.h" 39 #include "chrome/browser/sessions/tab_restore_service.h"
39 #include "chrome/browser/status_bubble.h" 40 #include "chrome/browser/status_bubble.h"
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1213 void Browser::ShowControlPanel() { 1214 void Browser::ShowControlPanel() {
1214 GURL url("http://localhost:8080"); 1215 GURL url("http://localhost:8080");
1215 AddTabWithURL(url, GURL(), PageTransition::AUTO_BOOKMARK, true, -1, 1216 AddTabWithURL(url, GURL(), PageTransition::AUTO_BOOKMARK, true, -1,
1216 false, NULL); 1217 false, NULL);
1217 } 1218 }
1218 #endif 1219 #endif
1219 1220
1220 /////////////////////////////////////////////////////////////////////////////// 1221 ///////////////////////////////////////////////////////////////////////////////
1221 1222
1222 // static 1223 // static
1224 void Browser::SetNewHomePagePrefs(PrefService* prefs) {
1225 prefs->SetString(prefs::kHomePage,
1226 ASCIIToWide(GoogleURLTracker::kDefaultGoogleHomepage));
1227 prefs->SetBoolean(prefs::kHomePageIsNewTabPage, false);
1228 prefs->SetBoolean(prefs::kShowHomeButton, true);
1229 }
1230
1231 // static
1223 void Browser::RegisterPrefs(PrefService* prefs) { 1232 void Browser::RegisterPrefs(PrefService* prefs) {
1224 prefs->RegisterDictionaryPref(prefs::kBrowserWindowPlacement); 1233 prefs->RegisterDictionaryPref(prefs::kBrowserWindowPlacement);
1225 prefs->RegisterIntegerPref(prefs::kOptionsWindowLastTabIndex, 0); 1234 prefs->RegisterIntegerPref(prefs::kOptionsWindowLastTabIndex, 0);
1226 prefs->RegisterIntegerPref(prefs::kDevToolsSplitLocation, -1); 1235 prefs->RegisterIntegerPref(prefs::kDevToolsSplitLocation, -1);
1227 } 1236 }
1228 1237
1229 // static 1238 // static
1230 void Browser::RegisterUserPrefs(PrefService* prefs) { 1239 void Browser::RegisterUserPrefs(PrefService* prefs) {
1231 prefs->RegisterStringPref(prefs::kHomePage, L"chrome-internal:"); 1240 prefs->RegisterStringPref(prefs::kHomePage, L"chrome-internal:");
1232 prefs->RegisterBooleanPref(prefs::kHomePageIsNewTabPage, true); 1241 prefs->RegisterBooleanPref(prefs::kHomePageIsNewTabPage, true);
(...skipping 1565 matching lines...) Expand 10 before | Expand all | Expand 10 after
2798 /////////////////////////////////////////////////////////////////////////////// 2807 ///////////////////////////////////////////////////////////////////////////////
2799 // BrowserToolbarModel (private): 2808 // BrowserToolbarModel (private):
2800 2809
2801 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { 2810 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() {
2802 // This |current_tab| can be NULL during the initialization of the 2811 // This |current_tab| can be NULL during the initialization of the
2803 // toolbar during window creation (i.e. before any tabs have been added 2812 // toolbar during window creation (i.e. before any tabs have been added
2804 // to the window). 2813 // to the window).
2805 TabContents* current_tab = browser_->GetSelectedTabContents(); 2814 TabContents* current_tab = browser_->GetSelectedTabContents();
2806 return current_tab ? &current_tab->controller() : NULL; 2815 return current_tab ? &current_tab->controller() : NULL;
2807 } 2816 }
OLDNEW
« no previous file with comments | « chrome/browser/browser.h ('k') | chrome/browser/browser_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698