| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
| 15 #include "base/prefs/pref_registry_simple.h" | |
| 16 #include "base/prefs/pref_service.h" | |
| 17 #include "base/prefs/scoped_user_pref_update.h" | |
| 18 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 19 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
| 20 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 21 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 22 #include "chrome/browser/platform_util.h" | 19 #include "chrome/browser/platform_util.h" |
| 23 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
| 24 #include "chrome/browser/tab_contents/tab_util.h" | 21 #include "chrome/browser/tab_contents/tab_util.h" |
| 25 #include "chrome/common/pref_names.h" | 22 #include "chrome/common/pref_names.h" |
| 23 #include "components/prefs/pref_registry_simple.h" |
| 24 #include "components/prefs/pref_service.h" |
| 25 #include "components/prefs/scoped_user_pref_update.h" |
| 26 #include "content/public/browser/browser_thread.h" | 26 #include "content/public/browser/browser_thread.h" |
| 27 #include "content/public/browser/web_contents.h" | 27 #include "content/public/browser/web_contents.h" |
| 28 #include "net/base/escape.h" | 28 #include "net/base/escape.h" |
| 29 #include "url/gurl.h" | 29 #include "url/gurl.h" |
| 30 | 30 |
| 31 using content::BrowserThread; | 31 using content::BrowserThread; |
| 32 | 32 |
| 33 // Whether we accept requests for launching external protocols. This is set to | 33 // Whether we accept requests for launching external protocols. This is set to |
| 34 // false every time an external protocol is requested, and set back to true on | 34 // false every time an external protocol is requested, and set back to true on |
| 35 // each user gesture. This variable should only be accessed from the UI thread. | 35 // each user gesture. This variable should only be accessed from the UI thread. |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 // static | 325 // static |
| 326 void ExternalProtocolHandler::RegisterPrefs(PrefRegistrySimple* registry) { | 326 void ExternalProtocolHandler::RegisterPrefs(PrefRegistrySimple* registry) { |
| 327 registry->RegisterDictionaryPref(prefs::kExcludedSchemes); | 327 registry->RegisterDictionaryPref(prefs::kExcludedSchemes); |
| 328 } | 328 } |
| 329 | 329 |
| 330 // static | 330 // static |
| 331 void ExternalProtocolHandler::PermitLaunchUrl() { | 331 void ExternalProtocolHandler::PermitLaunchUrl() { |
| 332 DCHECK(base::MessageLoopForUI::IsCurrent()); | 332 DCHECK(base::MessageLoopForUI::IsCurrent()); |
| 333 g_accept_requests = true; | 333 g_accept_requests = true; |
| 334 } | 334 } |
| OLD | NEW |