| 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 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 904 base::Bind(&TabSpecificContentSettings::CookieChanged, render_process_id, | 904 base::Bind(&TabSpecificContentSettings::CookieChanged, render_process_id, |
| 905 render_view_id, url, cookie_line, *options, !allow)); | 905 render_view_id, url, cookie_line, *options, !allow)); |
| 906 return allow; | 906 return allow; |
| 907 } | 907 } |
| 908 | 908 |
| 909 bool ChromeContentBrowserClient::AllowSaveLocalState( | 909 bool ChromeContentBrowserClient::AllowSaveLocalState( |
| 910 content::ResourceContext* context) { | 910 content::ResourceContext* context) { |
| 911 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 911 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 912 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); | 912 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); |
| 913 | 913 |
| 914 if (!io_data->clear_local_state_on_exit()->GetValue()) | 914 return !io_data->clear_local_state_on_exit()->GetValue(); |
| 915 return true; | |
| 916 | |
| 917 // Disable clearing the local state on exit if the browsing session is going | |
| 918 // to be restored on the next startup. | |
| 919 SessionStartupPref::Type startup_pref = | |
| 920 SessionStartupPref::PrefValueToType( | |
| 921 io_data->session_startup_pref()->GetValue()); | |
| 922 return (startup_pref == SessionStartupPref::LAST && | |
| 923 !CommandLine::ForCurrentProcess()->HasSwitch( | |
| 924 switches::kDisableRestoreSessionState)); | |
| 925 } | 915 } |
| 926 | 916 |
| 927 bool ChromeContentBrowserClient::AllowWorkerDatabase( | 917 bool ChromeContentBrowserClient::AllowWorkerDatabase( |
| 928 const GURL& url, | 918 const GURL& url, |
| 929 const string16& name, | 919 const string16& name, |
| 930 const string16& display_name, | 920 const string16& display_name, |
| 931 unsigned long estimated_size, | 921 unsigned long estimated_size, |
| 932 content::ResourceContext* context, | 922 content::ResourceContext* context, |
| 933 const std::vector<std::pair<int, int> >& render_views) { | 923 const std::vector<std::pair<int, int> >& render_views) { |
| 934 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 924 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1644 #if defined(USE_NSS) | 1634 #if defined(USE_NSS) |
| 1645 crypto::CryptoModuleBlockingPasswordDelegate* | 1635 crypto::CryptoModuleBlockingPasswordDelegate* |
| 1646 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 1636 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
| 1647 const GURL& url) { | 1637 const GURL& url) { |
| 1648 return browser::NewCryptoModuleBlockingDialogDelegate( | 1638 return browser::NewCryptoModuleBlockingDialogDelegate( |
| 1649 browser::kCryptoModulePasswordKeygen, url.host()); | 1639 browser::kCryptoModulePasswordKeygen, url.host()); |
| 1650 } | 1640 } |
| 1651 #endif | 1641 #endif |
| 1652 | 1642 |
| 1653 } // namespace chrome | 1643 } // namespace chrome |
| OLD | NEW |