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/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1417 } | 1417 } |
1418 | 1418 |
1419 FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { | 1419 FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { |
1420 return download_util::GetDefaultDownloadDirectory(); | 1420 return download_util::GetDefaultDownloadDirectory(); |
1421 } | 1421 } |
1422 | 1422 |
1423 std::string ChromeContentBrowserClient::GetDefaultDownloadName() { | 1423 std::string ChromeContentBrowserClient::GetDefaultDownloadName() { |
1424 return l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME); | 1424 return l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME); |
1425 } | 1425 } |
1426 | 1426 |
1427 bool ChromeContentBrowserClient::AllowSocketAPI(const GURL& url) { | 1427 bool ChromeContentBrowserClient::AllowSocketAPI( |
1428 return url.is_valid() && | 1428 content::BrowserContext* browser_context, const GURL& url) { |
1429 allowed_socket_origins_.find(url.host()) != allowed_socket_origins_.end(); | 1429 if (!url.is_valid()) |
1430 return false; | |
1431 | |
1432 std::string host = url.host(); | |
1433 if (allowed_socket_origins_.count(host)) | |
1434 return true; | |
1435 | |
1436 Profile* profile = Profile::FromBrowserContext(browser_context); | |
1437 if (!profile || !profile->GetExtensionService()) | |
1438 return false; | |
1439 | |
1440 const Extension* extension = profile->GetExtensionService()->extensions()-> | |
1441 GetExtensionOrAppByURL(ExtensionURLInfo(url)); | |
1442 if (!extension) | |
1443 return false; | |
1444 | |
1445 if (extension->HasAPIPermission(ExtensionAPIPermission::kSocket)) | |
Mihai Parparita -not on Chrome
2012/03/01 06:25:31
I may need some more context about this CL, but I
Dmitry Polukhin
2012/03/01 06:36:05
I'm sorry I'm not sure that I understand what do y
| |
1446 return true; | |
1447 | |
1448 return false; | |
1430 } | 1449 } |
1431 | 1450 |
1432 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 1451 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
1433 int ChromeContentBrowserClient::GetCrashSignalFD( | 1452 int ChromeContentBrowserClient::GetCrashSignalFD( |
1434 const CommandLine& command_line) { | 1453 const CommandLine& command_line) { |
1435 #if defined(OS_ANDROID) | 1454 #if defined(OS_ANDROID) |
1436 // TODO(carlosvaldivia): Upstream breakpad code for Android and remove this | 1455 // TODO(carlosvaldivia): Upstream breakpad code for Android and remove this |
1437 // fork. http://crbug.com/113560 | 1456 // fork. http://crbug.com/113560 |
1438 NOTIMPLEMENTED(); | 1457 NOTIMPLEMENTED(); |
1439 #else | 1458 #else |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1472 #if defined(USE_NSS) | 1491 #if defined(USE_NSS) |
1473 crypto::CryptoModuleBlockingPasswordDelegate* | 1492 crypto::CryptoModuleBlockingPasswordDelegate* |
1474 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 1493 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
1475 const GURL& url) { | 1494 const GURL& url) { |
1476 return browser::NewCryptoModuleBlockingDialogDelegate( | 1495 return browser::NewCryptoModuleBlockingDialogDelegate( |
1477 browser::kCryptoModulePasswordKeygen, url.host()); | 1496 browser::kCryptoModulePasswordKeygen, url.host()); |
1478 } | 1497 } |
1479 #endif | 1498 #endif |
1480 | 1499 |
1481 } // namespace chrome | 1500 } // namespace chrome |
OLD | NEW |