OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 #include <windows.h> | 9 #include <windows.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 2076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2087 prefs->RegisterBooleanPref(prefs::kEnableTranslate, true); | 2087 prefs->RegisterBooleanPref(prefs::kEnableTranslate, true); |
2088 prefs->RegisterBooleanPref(prefs::kRemotingHasSetupCompleted, false); | 2088 prefs->RegisterBooleanPref(prefs::kRemotingHasSetupCompleted, false); |
2089 prefs->RegisterStringPref(prefs::kCloudPrintEmail, std::string()); | 2089 prefs->RegisterStringPref(prefs::kCloudPrintEmail, std::string()); |
2090 prefs->RegisterBooleanPref(prefs::kCloudPrintProxyEnabled, true); | 2090 prefs->RegisterBooleanPref(prefs::kCloudPrintProxyEnabled, true); |
2091 prefs->RegisterBooleanPref(prefs::kDevToolsDisabled, false); | 2091 prefs->RegisterBooleanPref(prefs::kDevToolsDisabled, false); |
2092 prefs->RegisterBooleanPref(prefs::kIncognitoEnabled, true); | 2092 prefs->RegisterBooleanPref(prefs::kIncognitoEnabled, true); |
2093 prefs->RegisterIntegerPref(prefs::kDevToolsSplitLocation, -1); | 2093 prefs->RegisterIntegerPref(prefs::kDevToolsSplitLocation, -1); |
2094 prefs->RegisterDictionaryPref(prefs::kBrowserWindowPlacement); | 2094 prefs->RegisterDictionaryPref(prefs::kBrowserWindowPlacement); |
2095 prefs->RegisterDictionaryPref(prefs::kPreferencesWindowPlacement); | 2095 prefs->RegisterDictionaryPref(prefs::kPreferencesWindowPlacement); |
2096 // We need to register the type of these preferences in order to query | 2096 // We need to register the type of these preferences in order to query |
2097 // them even though they're only typically controlled via policy. | 2097 // them even though they're typically only controlled via policy or command |
| 2098 // line switches. |
2098 prefs->RegisterBooleanPref(prefs::kDisable3DAPIs, false); | 2099 prefs->RegisterBooleanPref(prefs::kDisable3DAPIs, false); |
2099 prefs->RegisterBooleanPref(prefs::kPluginsAllowOutdated, false); | 2100 prefs->RegisterBooleanPref(prefs::kPluginsAllowOutdated, false); |
| 2101 prefs->RegisterBooleanPref(prefs::kEnableHyperlinkAuditing, true); |
| 2102 prefs->RegisterBooleanPref(prefs::kEnableReferrers, true); |
2100 } | 2103 } |
2101 | 2104 |
2102 // static | 2105 // static |
2103 bool Browser::RunUnloadEventsHelper(TabContents* contents) { | 2106 bool Browser::RunUnloadEventsHelper(TabContents* contents) { |
2104 // If the TabContents is not connected yet, then there's no unload | 2107 // If the TabContents is not connected yet, then there's no unload |
2105 // handler we can fire even if the TabContents has an unload listener. | 2108 // handler we can fire even if the TabContents has an unload listener. |
2106 // One case where we hit this is in a tab that has an infinite loop | 2109 // One case where we hit this is in a tab that has an infinite loop |
2107 // before load. | 2110 // before load. |
2108 if (contents->NeedToFireBeforeUnload()) { | 2111 if (contents->NeedToFireBeforeUnload()) { |
2109 // If the page has unload listeners, then we tell the renderer to fire | 2112 // If the page has unload listeners, then we tell the renderer to fire |
(...skipping 2305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4415 // The page transition below is only for the purpose of inserting the tab. | 4418 // The page transition below is only for the purpose of inserting the tab. |
4416 browser->AddTab(view_source_contents, PageTransition::LINK); | 4419 browser->AddTab(view_source_contents, PageTransition::LINK); |
4417 } | 4420 } |
4418 | 4421 |
4419 if (profile_->HasSessionService()) { | 4422 if (profile_->HasSessionService()) { |
4420 SessionService* session_service = profile_->GetSessionService(); | 4423 SessionService* session_service = profile_->GetSessionService(); |
4421 if (session_service) | 4424 if (session_service) |
4422 session_service->TabRestored(&view_source_contents->controller(), false); | 4425 session_service->TabRestored(&view_source_contents->controller(), false); |
4423 } | 4426 } |
4424 } | 4427 } |
OLD | NEW |