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" |
37 #ifdef CHROME_PERSONALIZATION | 38 #ifdef CHROME_PERSONALIZATION |
38 #include "chrome/personalization/personalization.h" | 39 #include "chrome/personalization/personalization.h" |
39 #endif | 40 #endif |
40 #include "net/base/cookie_monster.h" | 41 #include "net/base/cookie_monster.h" |
41 #include "net/base/cookie_policy.h" | 42 #include "net/base/cookie_policy.h" |
42 #include "net/base/net_util.h" | 43 #include "net/base/net_util.h" |
43 #include "net/base/registry_controlled_domain.h" | 44 #include "net/base/registry_controlled_domain.h" |
44 #include "net/url_request/url_request_context.h" | 45 #include "net/url_request/url_request_context.h" |
45 #include "webkit/glue/window_open_disposition.h" | 46 #include "webkit/glue/window_open_disposition.h" |
46 | 47 |
(...skipping 2217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2264 int selected_navigation) { | 2265 int selected_navigation) { |
2265 if (!navigations.empty()) { | 2266 if (!navigations.empty()) { |
2266 DCHECK(selected_navigation >= 0 && | 2267 DCHECK(selected_navigation >= 0 && |
2267 selected_navigation < static_cast<int>(navigations.size())); | 2268 selected_navigation < static_cast<int>(navigations.size())); |
2268 // Create a NavigationController. This constructor creates the appropriate | 2269 // Create a NavigationController. This constructor creates the appropriate |
2269 // set of TabContents. | 2270 // set of TabContents. |
2270 return new NavigationController(profile_, navigations, selected_navigation); | 2271 return new NavigationController(profile_, navigations, selected_navigation); |
2271 } else { | 2272 } else { |
2272 // No navigations. Create a tab with about:blank. | 2273 // No navigations. Create a tab with about:blank. |
2273 TabContents* contents = | 2274 TabContents* contents = |
2274 CreateTabContentsForURL(GURL("about:blank"), GURL(), profile_, | 2275 CreateTabContentsForURL(GURL(chrome::kAboutBlankURL), GURL(), profile_, |
2275 PageTransition::START_PAGE, false, NULL); | 2276 PageTransition::START_PAGE, false, NULL); |
2276 return new NavigationController(contents, profile_); | 2277 return new NavigationController(contents, profile_); |
2277 } | 2278 } |
2278 } | 2279 } |
2279 | 2280 |
2280 /////////////////////////////////////////////////////////////////////////////// | 2281 /////////////////////////////////////////////////////////////////////////////// |
2281 // Browser, OnBeforeUnload handling (private): | 2282 // Browser, OnBeforeUnload handling (private): |
2282 | 2283 |
2283 void Browser::ProcessPendingTabs() { | 2284 void Browser::ProcessPendingTabs() { |
2284 DCHECK(is_attempting_to_close_browser_); | 2285 DCHECK(is_attempting_to_close_browser_); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2426 | 2427 |
2427 // We need to register the window position pref. | 2428 // We need to register the window position pref. |
2428 std::wstring window_pref(prefs::kBrowserWindowPlacement); | 2429 std::wstring window_pref(prefs::kBrowserWindowPlacement); |
2429 window_pref.append(L"_"); | 2430 window_pref.append(L"_"); |
2430 window_pref.append(app_name); | 2431 window_pref.append(app_name); |
2431 PrefService* prefs = g_browser_process->local_state(); | 2432 PrefService* prefs = g_browser_process->local_state(); |
2432 DCHECK(prefs); | 2433 DCHECK(prefs); |
2433 | 2434 |
2434 prefs->RegisterDictionaryPref(window_pref.c_str()); | 2435 prefs->RegisterDictionaryPref(window_pref.c_str()); |
2435 } | 2436 } |
OLD | NEW |