| 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/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/app/breakpad_mac.h" | 8 #include "chrome/app/breakpad_mac.h" |
| 9 #include "chrome/browser/browser_about_handler.h" | 9 #include "chrome/browser/browser_about_handler.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 } | 467 } |
| 468 | 468 |
| 469 bool ChromeContentBrowserClient::AllowSaveLocalState( | 469 bool ChromeContentBrowserClient::AllowSaveLocalState( |
| 470 const content::ResourceContext& context) { | 470 const content::ResourceContext& context) { |
| 471 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 471 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 472 ProfileIOData* io_data = | 472 ProfileIOData* io_data = |
| 473 reinterpret_cast<ProfileIOData*>(context.GetUserData(NULL)); | 473 reinterpret_cast<ProfileIOData*>(context.GetUserData(NULL)); |
| 474 return !io_data->clear_local_state_on_exit()->GetValue(); | 474 return !io_data->clear_local_state_on_exit()->GetValue(); |
| 475 } | 475 } |
| 476 | 476 |
| 477 bool ChromeContentBrowserClient::AllowPermanentStorage( |
| 478 const GURL& url, |
| 479 const GURL& first_party, |
| 480 const content::ResourceContext& context) { |
| 481 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 482 ProfileIOData* io_data = |
| 483 reinterpret_cast<ProfileIOData*>(context.GetUserData(NULL)); |
| 484 ContentSetting setting = io_data->GetHostContentSettingsMap()-> |
| 485 GetCookieContentSetting(url, first_party, true); |
| 486 |
| 487 return (setting == CONTENT_SETTING_ALLOW); |
| 488 } |
| 489 |
| 477 net::URLRequestContext* | 490 net::URLRequestContext* |
| 478 ChromeContentBrowserClient::OverrideRequestContextForURL( | 491 ChromeContentBrowserClient::OverrideRequestContextForURL( |
| 479 const GURL& url, const content::ResourceContext& context) { | 492 const GURL& url, const content::ResourceContext& context) { |
| 480 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 493 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 481 if (url.SchemeIs(chrome::kExtensionScheme)) { | 494 if (url.SchemeIs(chrome::kExtensionScheme)) { |
| 482 ProfileIOData* io_data = | 495 ProfileIOData* io_data = |
| 483 reinterpret_cast<ProfileIOData*>(context.GetUserData(NULL)); | 496 reinterpret_cast<ProfileIOData*>(context.GetUserData(NULL)); |
| 484 return io_data->extensions_request_context(); | 497 return io_data->extensions_request_context(); |
| 485 } | 498 } |
| 486 | 499 |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 #if defined(USE_NSS) | 794 #if defined(USE_NSS) |
| 782 crypto::CryptoModuleBlockingPasswordDelegate* | 795 crypto::CryptoModuleBlockingPasswordDelegate* |
| 783 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 796 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
| 784 const GURL& url) { | 797 const GURL& url) { |
| 785 return browser::NewCryptoModuleBlockingDialogDelegate( | 798 return browser::NewCryptoModuleBlockingDialogDelegate( |
| 786 browser::kCryptoModulePasswordKeygen, url.host()); | 799 browser::kCryptoModulePasswordKeygen, url.host()); |
| 787 } | 800 } |
| 788 #endif | 801 #endif |
| 789 | 802 |
| 790 } // namespace chrome | 803 } // namespace chrome |
| OLD | NEW |