| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/external_protocol/external_protocol_handler.h" | 5 #include "chrome/browser/external_protocol/external_protocol_handler.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 "view-source", | 187 "view-source", |
| 188 "vnd.ms.radio", | 188 "vnd.ms.radio", |
| 189 }; | 189 }; |
| 190 | 190 |
| 191 static const char* const allowed_schemes[] = { | 191 static const char* const allowed_schemes[] = { |
| 192 "mailto", | 192 "mailto", |
| 193 "news", | 193 "news", |
| 194 "snews", | 194 "snews", |
| 195 #if defined(OS_WIN) | 195 #if defined(OS_WIN) |
| 196 "ms-windows-store", | 196 "ms-windows-store", |
| 197 "ms-cortana", |
| 197 #endif | 198 #endif |
| 198 }; | 199 }; |
| 199 | 200 |
| 200 bool should_block; | 201 bool should_block; |
| 201 for (size_t i = 0; i < arraysize(denied_schemes); ++i) { | 202 for (size_t i = 0; i < arraysize(denied_schemes); ++i) { |
| 202 if (!win_pref->GetBoolean(denied_schemes[i], &should_block)) { | 203 if (!win_pref->GetBoolean(denied_schemes[i], &should_block)) { |
| 203 win_pref->SetBoolean(denied_schemes[i], true); | 204 win_pref->SetBoolean(denied_schemes[i], true); |
| 204 } | 205 } |
| 205 } | 206 } |
| 206 | 207 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 // static | 323 // static |
| 323 void ExternalProtocolHandler::RegisterPrefs(PrefRegistrySimple* registry) { | 324 void ExternalProtocolHandler::RegisterPrefs(PrefRegistrySimple* registry) { |
| 324 registry->RegisterDictionaryPref(prefs::kExcludedSchemes); | 325 registry->RegisterDictionaryPref(prefs::kExcludedSchemes); |
| 325 } | 326 } |
| 326 | 327 |
| 327 // static | 328 // static |
| 328 void ExternalProtocolHandler::PermitLaunchUrl() { | 329 void ExternalProtocolHandler::PermitLaunchUrl() { |
| 329 DCHECK(base::MessageLoopForUI::IsCurrent()); | 330 DCHECK(base::MessageLoopForUI::IsCurrent()); |
| 330 g_accept_requests = true; | 331 g_accept_requests = true; |
| 331 } | 332 } |
| OLD | NEW |