| 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/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| 11 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
| 12 #include "chrome/browser/android/tab_android.h" | |
| 13 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 14 #include "chrome/browser/net/predictor.h" | 13 #include "chrome/browser/net/predictor.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/profiles/profile_manager.h" | 15 #include "chrome/browser/profiles/profile_manager.h" |
| 17 #include "chrome/browser/safe_browsing/protocol_manager.h" | 16 #include "chrome/browser/safe_browsing/protocol_manager.h" |
| 18 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 17 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 19 #include "chrome/common/chrome_content_client.h" | 18 #include "chrome/common/chrome_content_client.h" |
| 20 #include "content/public/browser/browser_thread.h" | 19 #include "content/public/browser/browser_thread.h" |
| 21 #include "content/public/browser/storage_partition.h" | 20 #include "content/public/browser/storage_partition.h" |
| 22 #include "content/public/browser/web_contents.h" | 21 #include "content/public/browser/web_contents.h" |
| 23 #include "jni/ChromeApplication_jni.h" | 22 #include "jni/ChromeApplication_jni.h" |
| 24 #include "net/cookies/cookie_monster.h" | 23 #include "net/cookies/cookie_monster.h" |
| 25 #include "net/cookies/cookie_store.h" | 24 #include "net/cookies/cookie_store.h" |
| 26 #include "net/url_request/url_request_context.h" | 25 #include "net/url_request/url_request_context.h" |
| 27 #include "net/url_request/url_request_context_getter.h" | 26 #include "net/url_request/url_request_context_getter.h" |
| 28 | 27 |
| 28 #if !defined(USE_AURA) |
| 29 #include "chrome/browser/android/tab_android.h" |
| 30 #endif |
| 31 |
| 29 using base::android::ConvertUTF8ToJavaString; | 32 using base::android::ConvertUTF8ToJavaString; |
| 30 | 33 |
| 31 namespace { | 34 namespace { |
| 32 | 35 |
| 33 void FlushCookiesOnIOThread( | 36 void FlushCookiesOnIOThread( |
| 34 scoped_refptr<net::URLRequestContextGetter> getter) { | 37 scoped_refptr<net::URLRequestContextGetter> getter) { |
| 35 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | 38 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
| 36 getter->GetURLRequestContext() | 39 getter->GetURLRequestContext() |
| 37 ->cookie_store() | 40 ->cookie_store() |
| 38 ->GetCookieMonster() | 41 ->GetCookieMonster() |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 } | 115 } |
| 113 | 116 |
| 114 namespace chrome { | 117 namespace chrome { |
| 115 namespace android { | 118 namespace android { |
| 116 | 119 |
| 117 // static | 120 // static |
| 118 bool ChromeApplication::RegisterBindings(JNIEnv* env) { | 121 bool ChromeApplication::RegisterBindings(JNIEnv* env) { |
| 119 return RegisterNativesImpl(env); | 122 return RegisterNativesImpl(env); |
| 120 } | 123 } |
| 121 | 124 |
| 122 void ChromeApplication::ShowAutofillSettings() { | 125 //void ChromeApplication::ShowAutofillSettings() { |
| 123 Java_ChromeApplication_showAutofillSettings( | 126 // Java_ChromeApplication_showAutofillSettings( |
| 124 base::android::AttachCurrentThread(), | 127 // base::android::AttachCurrentThread(), |
| 125 base::android::GetApplicationContext()); | 128 // base::android::GetApplicationContext()); |
| 126 } | 129 //} |
| 127 | 130 |
| 128 void ChromeApplication::ShowPasswordSettings() { | 131 //void ChromeApplication::ShowPasswordSettings() { |
| 129 Java_ChromeApplication_showPasswordSettings( | 132 // Java_ChromeApplication_showPasswordSettings( |
| 130 base::android::AttachCurrentThread(), | 133 // base::android::AttachCurrentThread(), |
| 131 base::android::GetApplicationContext()); | 134 // base::android::GetApplicationContext()); |
| 132 } | 135 //} |
| 133 | 136 |
| 134 void ChromeApplication::OpenClearBrowsingData( | 137 void ChromeApplication::OpenClearBrowsingData( |
| 135 content::WebContents* web_contents) { | 138 content::WebContents* web_contents) { |
| 139 #if !defined(USE_AURA) |
| 136 TabAndroid* tab = TabAndroid::FromWebContents(web_contents); | 140 TabAndroid* tab = TabAndroid::FromWebContents(web_contents); |
| 137 DCHECK(tab); | 141 DCHECK(tab); |
| 138 Java_ChromeApplication_openClearBrowsingData( | 142 Java_ChromeApplication_openClearBrowsingData( |
| 139 base::android::AttachCurrentThread(), | 143 base::android::AttachCurrentThread(), |
| 140 base::android::GetApplicationContext(), | 144 base::android::GetApplicationContext(), |
| 141 tab->GetJavaObject().obj()); | 145 tab->GetJavaObject().obj()); |
| 146 #endif |
| 142 } | 147 } |
| 143 | 148 |
| 144 bool ChromeApplication::AreParentalControlsEnabled() { | 149 bool ChromeApplication::AreParentalControlsEnabled() { |
| 145 return Java_ChromeApplication_areParentalControlsEnabled( | 150 return Java_ChromeApplication_areParentalControlsEnabled( |
| 146 base::android::AttachCurrentThread(), | 151 base::android::AttachCurrentThread(), |
| 147 base::android::GetApplicationContext()); | 152 base::android::GetApplicationContext()); |
| 148 } | 153 } |
| 149 | 154 |
| 150 } // namespace android | 155 } // namespace android |
| 151 } // namespace chrome | 156 } // namespace chrome |
| OLD | NEW |