| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/android/chrome_application.h" | 5 #include "chrome/browser/android/chrome_application.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/android/context_utils.h" | 9 #include "base/android/context_utils.h" |
| 10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| 11 #include "base/android/jni_string.h" | 11 #include "base/android/jni_string.h" |
| 12 #include "base/prefs/pref_service.h" | 12 #include "base/prefs/pref_service.h" |
| 13 #include "chrome/browser/android/tab_android.h" | 13 #include "chrome/browser/android/tab_android.h" |
| 14 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
| 15 #include "chrome/browser/net/predictor.h" | 15 #include "chrome/browser/net/predictor.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/profiles/profile_manager.h" | 17 #include "chrome/browser/profiles/profile_manager.h" |
| 18 #include "chrome/browser/safe_browsing/protocol_manager.h" | 18 #include "chrome/browser/safe_browsing/protocol_manager.h" |
| 19 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 19 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 20 #include "chrome/common/chrome_content_client.h" | 20 #include "chrome/common/chrome_content_client.h" |
| 21 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
| 22 #include "content/public/browser/storage_partition.h" | 22 #include "content/public/browser/storage_partition.h" |
| 23 #include "content/public/browser/web_contents.h" | 23 #include "content/public/browser/web_contents.h" |
| 24 #include "jni/ChromeApplication_jni.h" | 24 #include "jni/ChromeApplication_jni.h" |
| 25 #include "net/cookies/cookie_monster.h" | |
| 26 #include "net/cookies/cookie_store.h" | 25 #include "net/cookies/cookie_store.h" |
| 27 #include "net/url_request/url_request_context.h" | 26 #include "net/url_request/url_request_context.h" |
| 28 #include "net/url_request/url_request_context_getter.h" | 27 #include "net/url_request/url_request_context_getter.h" |
| 29 | 28 |
| 30 using base::android::ConvertUTF8ToJavaString; | 29 using base::android::ConvertUTF8ToJavaString; |
| 31 | 30 |
| 32 namespace { | 31 namespace { |
| 33 | 32 |
| 34 void FlushCookiesOnIOThread( | 33 void FlushCookiesOnIOThread( |
| 35 scoped_refptr<net::URLRequestContextGetter> getter) { | 34 scoped_refptr<net::URLRequestContextGetter> getter) { |
| 36 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | 35 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
| 37 getter->GetURLRequestContext() | 36 getter->GetURLRequestContext()->cookie_store()->FlushStore(base::Closure()); |
| 38 ->cookie_store() | |
| 39 ->GetCookieMonster() | |
| 40 ->FlushStore(base::Closure()); | |
| 41 } | 37 } |
| 42 | 38 |
| 43 void FlushStoragePartition(content::StoragePartition* partition) { | 39 void FlushStoragePartition(content::StoragePartition* partition) { |
| 44 partition->Flush(); | 40 partition->Flush(); |
| 45 } | 41 } |
| 46 | 42 |
| 47 void CommitPendingWritesForProfile(Profile* profile) { | 43 void CommitPendingWritesForProfile(Profile* profile) { |
| 48 // These calls are asynchronous. They may not finish (and may not even | 44 // These calls are asynchronous. They may not finish (and may not even |
| 49 // start!) before the Android OS kills our process. But we can't wait for them | 45 // start!) before the Android OS kills our process. But we can't wait for them |
| 50 // to finish because blocking the UI thread is illegal. | 46 // to finish because blocking the UI thread is illegal. |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 } | 144 } |
| 149 | 145 |
| 150 bool ChromeApplication::AreParentalControlsEnabled() { | 146 bool ChromeApplication::AreParentalControlsEnabled() { |
| 151 return Java_ChromeApplication_areParentalControlsEnabled( | 147 return Java_ChromeApplication_areParentalControlsEnabled( |
| 152 base::android::AttachCurrentThread(), | 148 base::android::AttachCurrentThread(), |
| 153 base::android::GetApplicationContext()); | 149 base::android::GetApplicationContext()); |
| 154 } | 150 } |
| 155 | 151 |
| 156 } // namespace android | 152 } // namespace android |
| 157 } // namespace chrome | 153 } // namespace chrome |
| OLD | NEW |