| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/idle_timer.h" | 8 #include "base/idle_timer.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "chrome/browser/tab_contents/site_instance.h" | 27 #include "chrome/browser/tab_contents/site_instance.h" |
| 28 #include "chrome/browser/tab_contents/tab_contents_type.h" | 28 #include "chrome/browser/tab_contents/tab_contents_type.h" |
| 29 #include "chrome/browser/tab_contents/web_contents.h" | 29 #include "chrome/browser/tab_contents/web_contents.h" |
| 30 #include "chrome/common/chrome_constants.h" | 30 #include "chrome/common/chrome_constants.h" |
| 31 #include "chrome/common/chrome_switches.h" | 31 #include "chrome/common/chrome_switches.h" |
| 32 #include "chrome/common/l10n_util.h" | 32 #include "chrome/common/l10n_util.h" |
| 33 #include "chrome/common/notification_service.h" | 33 #include "chrome/common/notification_service.h" |
| 34 #include "chrome/common/page_transition_types.h" | 34 #include "chrome/common/page_transition_types.h" |
| 35 #include "chrome/common/pref_names.h" | 35 #include "chrome/common/pref_names.h" |
| 36 #include "chrome/common/pref_service.h" | 36 #include "chrome/common/pref_service.h" |
| 37 #include "chrome/common/url_constants.h" | |
| 38 #ifdef CHROME_PERSONALIZATION | 37 #ifdef CHROME_PERSONALIZATION |
| 39 #include "chrome/personalization/personalization.h" | 38 #include "chrome/personalization/personalization.h" |
| 40 #endif | 39 #endif |
| 41 #include "net/base/cookie_monster.h" | 40 #include "net/base/cookie_monster.h" |
| 42 #include "net/base/cookie_policy.h" | 41 #include "net/base/cookie_policy.h" |
| 43 #include "net/base/net_util.h" | 42 #include "net/base/net_util.h" |
| 44 #include "net/base/registry_controlled_domain.h" | 43 #include "net/base/registry_controlled_domain.h" |
| 45 #include "net/url_request/url_request_context.h" | 44 #include "net/url_request/url_request_context.h" |
| 46 #include "webkit/glue/window_open_disposition.h" | 45 #include "webkit/glue/window_open_disposition.h" |
| 47 | 46 |
| (...skipping 2230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2278 int selected_navigation) { | 2277 int selected_navigation) { |
| 2279 if (!navigations.empty()) { | 2278 if (!navigations.empty()) { |
| 2280 DCHECK(selected_navigation >= 0 && | 2279 DCHECK(selected_navigation >= 0 && |
| 2281 selected_navigation < static_cast<int>(navigations.size())); | 2280 selected_navigation < static_cast<int>(navigations.size())); |
| 2282 // Create a NavigationController. This constructor creates the appropriate | 2281 // Create a NavigationController. This constructor creates the appropriate |
| 2283 // set of TabContents. | 2282 // set of TabContents. |
| 2284 return new NavigationController(profile_, navigations, selected_navigation); | 2283 return new NavigationController(profile_, navigations, selected_navigation); |
| 2285 } else { | 2284 } else { |
| 2286 // No navigations. Create a tab with about:blank. | 2285 // No navigations. Create a tab with about:blank. |
| 2287 TabContents* contents = | 2286 TabContents* contents = |
| 2288 CreateTabContentsForURL(GURL(chrome::kAboutBlankURL), GURL(), profile_, | 2287 CreateTabContentsForURL(GURL("about:blank"), GURL(), profile_, |
| 2289 PageTransition::START_PAGE, false, NULL); | 2288 PageTransition::START_PAGE, false, NULL); |
| 2290 return new NavigationController(contents, profile_); | 2289 return new NavigationController(contents, profile_); |
| 2291 } | 2290 } |
| 2292 } | 2291 } |
| 2293 | 2292 |
| 2294 /////////////////////////////////////////////////////////////////////////////// | 2293 /////////////////////////////////////////////////////////////////////////////// |
| 2295 // Browser, OnBeforeUnload handling (private): | 2294 // Browser, OnBeforeUnload handling (private): |
| 2296 | 2295 |
| 2297 void Browser::ProcessPendingTabs() { | 2296 void Browser::ProcessPendingTabs() { |
| 2298 DCHECK(is_attempting_to_close_browser_); | 2297 DCHECK(is_attempting_to_close_browser_); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2443 | 2442 |
| 2444 // We need to register the window position pref. | 2443 // We need to register the window position pref. |
| 2445 std::wstring window_pref(prefs::kBrowserWindowPlacement); | 2444 std::wstring window_pref(prefs::kBrowserWindowPlacement); |
| 2446 window_pref.append(L"_"); | 2445 window_pref.append(L"_"); |
| 2447 window_pref.append(app_name); | 2446 window_pref.append(app_name); |
| 2448 PrefService* prefs = g_browser_process->local_state(); | 2447 PrefService* prefs = g_browser_process->local_state(); |
| 2449 DCHECK(prefs); | 2448 DCHECK(prefs); |
| 2450 | 2449 |
| 2451 prefs->RegisterDictionaryPref(window_pref.c_str()); | 2450 prefs->RegisterDictionaryPref(window_pref.c_str()); |
| 2452 } | 2451 } |
| OLD | NEW |