Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 7480041: Adding session-only localStorage. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Streamlining: Moving ResourceContext& from DOMStorageContext to DOMMessageFilter. Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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::EnforceSessionOnlyStorage(
478 const GURL& url,
479 const GURL& first_party_url,
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_url, true);
486
487 return (setting == CONTENT_SETTING_SESSION_ONLY);
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
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
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | content/browser/content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698