OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "app/animation.h" | 10 #include "app/animation.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 #include "chrome/common/notification_service.h" | 68 #include "chrome/common/notification_service.h" |
69 #include "chrome/common/page_transition_types.h" | 69 #include "chrome/common/page_transition_types.h" |
70 #include "chrome/common/platform_util.h" | 70 #include "chrome/common/platform_util.h" |
71 #include "chrome/common/pref_names.h" | 71 #include "chrome/common/pref_names.h" |
72 #include "chrome/common/pref_service.h" | 72 #include "chrome/common/pref_service.h" |
73 #include "chrome/common/url_constants.h" | 73 #include "chrome/common/url_constants.h" |
74 #include "grit/chromium_strings.h" | 74 #include "grit/chromium_strings.h" |
75 #include "grit/generated_resources.h" | 75 #include "grit/generated_resources.h" |
76 #include "grit/locale_settings.h" | 76 #include "grit/locale_settings.h" |
77 #include "net/base/cookie_monster.h" | 77 #include "net/base/cookie_monster.h" |
78 #include "net/base/cookie_policy.h" | |
79 #include "net/base/net_util.h" | 78 #include "net/base/net_util.h" |
80 #include "net/base/registry_controlled_domain.h" | 79 #include "net/base/registry_controlled_domain.h" |
| 80 #include "net/base/static_cookie_policy.h" |
81 #include "net/url_request/url_request_context.h" | 81 #include "net/url_request/url_request_context.h" |
82 #include "webkit/glue/window_open_disposition.h" | 82 #include "webkit/glue/window_open_disposition.h" |
83 | 83 |
84 #if defined(OS_WIN) | 84 #if defined(OS_WIN) |
85 #include <windows.h> | 85 #include <windows.h> |
86 #include <shellapi.h> | 86 #include <shellapi.h> |
87 | 87 |
88 #include "app/win_util.h" | 88 #include "app/win_util.h" |
89 #include "chrome/browser/browser_url_handler.h" | 89 #include "chrome/browser/browser_url_handler.h" |
90 #include "chrome/browser/cert_store.h" | 90 #include "chrome/browser/cert_store.h" |
(...skipping 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1355 prefs->RegisterIntegerPref(prefs::kOptionsWindowLastTabIndex, 0); | 1355 prefs->RegisterIntegerPref(prefs::kOptionsWindowLastTabIndex, 0); |
1356 prefs->RegisterIntegerPref(prefs::kDevToolsSplitLocation, -1); | 1356 prefs->RegisterIntegerPref(prefs::kDevToolsSplitLocation, -1); |
1357 } | 1357 } |
1358 | 1358 |
1359 // static | 1359 // static |
1360 void Browser::RegisterUserPrefs(PrefService* prefs) { | 1360 void Browser::RegisterUserPrefs(PrefService* prefs) { |
1361 prefs->RegisterStringPref(prefs::kHomePage, | 1361 prefs->RegisterStringPref(prefs::kHomePage, |
1362 ASCIIToWide(chrome::kChromeUINewTabURL)); | 1362 ASCIIToWide(chrome::kChromeUINewTabURL)); |
1363 prefs->RegisterBooleanPref(prefs::kHomePageIsNewTabPage, true); | 1363 prefs->RegisterBooleanPref(prefs::kHomePageIsNewTabPage, true); |
1364 prefs->RegisterIntegerPref(prefs::kCookieBehavior, | 1364 prefs->RegisterIntegerPref(prefs::kCookieBehavior, |
1365 net::CookiePolicy::ALLOW_ALL_COOKIES); | 1365 net::StaticCookiePolicy::ALLOW_ALL_COOKIES); |
1366 prefs->RegisterBooleanPref(prefs::kShowHomeButton, false); | 1366 prefs->RegisterBooleanPref(prefs::kShowHomeButton, false); |
1367 #if defined(OS_MACOSX) | 1367 #if defined(OS_MACOSX) |
1368 // This really belongs in platform code, but there's no good place to | 1368 // This really belongs in platform code, but there's no good place to |
1369 // initialize it between the time when the AppController is created | 1369 // initialize it between the time when the AppController is created |
1370 // (where there's no profile) and the time the controller gets another | 1370 // (where there's no profile) and the time the controller gets another |
1371 // crack at the start of the main event loop. By that time, BrowserInit | 1371 // crack at the start of the main event loop. By that time, BrowserInit |
1372 // has already created the browser window, and it's too late: we need the | 1372 // has already created the browser window, and it's too late: we need the |
1373 // pref to be already initialized. Doing it here also saves us from having | 1373 // pref to be already initialized. Doing it here also saves us from having |
1374 // to hard-code pref registration in the several unit tests that use | 1374 // to hard-code pref registration in the several unit tests that use |
1375 // this preference. | 1375 // this preference. |
(...skipping 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3228 if (TabHasUnloadListener(contents)) { | 3228 if (TabHasUnloadListener(contents)) { |
3229 // If the page has unload listeners, then we tell the renderer to fire | 3229 // If the page has unload listeners, then we tell the renderer to fire |
3230 // them. Once they have fired, we'll get a message back saying whether | 3230 // them. Once they have fired, we'll get a message back saying whether |
3231 // to proceed closing the page or not, which sends us back to this method | 3231 // to proceed closing the page or not, which sends us back to this method |
3232 // with the HasUnloadListener bit cleared. | 3232 // with the HasUnloadListener bit cleared. |
3233 contents->render_view_host()->FirePageBeforeUnload(false); | 3233 contents->render_view_host()->FirePageBeforeUnload(false); |
3234 return true; | 3234 return true; |
3235 } | 3235 } |
3236 return false; | 3236 return false; |
3237 } | 3237 } |
OLD | NEW |