OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/android/toolbar/toolbar_model_android.h" | 5 #include "chrome/browser/ui/android/toolbar/toolbar_model_android.h" |
6 | 6 |
7 #include "base/android/jni_string.h" | 7 #include "base/android/jni_string.h" |
8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/search/search.h" | 10 #include "chrome/browser/search/search.h" |
11 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" | 11 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" |
12 #include "components/toolbar/toolbar_model_impl.h" | 12 #include "components/toolbar/toolbar_model_impl.h" |
13 #include "content/public/browser/cert_store.h" | 13 #include "content/public/browser/cert_store.h" |
14 #include "content/public/browser/navigation_entry.h" | 14 #include "content/public/browser/navigation_entry.h" |
15 #include "content/public/browser/web_contents.h" | 15 #include "content/public/browser/web_contents.h" |
16 #include "content/public/common/content_constants.h" | 16 #include "content/public/common/content_constants.h" |
17 #include "content/public/common/ssl_status.h" | 17 #include "content/public/common/ssl_status.h" |
18 #include "jni/ToolbarModel_jni.h" | 18 #include "jni/ToolbarModel_jni.h" |
19 #include "net/cert/x509_certificate.h" | 19 #include "net/cert/x509_certificate.h" |
20 | 20 |
| 21 using base::android::JavaParamRef; |
21 using base::android::ScopedJavaLocalRef; | 22 using base::android::ScopedJavaLocalRef; |
22 | 23 |
23 ToolbarModelAndroid::ToolbarModelAndroid(JNIEnv* env, jobject jdelegate) | 24 ToolbarModelAndroid::ToolbarModelAndroid(JNIEnv* env, jobject jdelegate) |
24 : toolbar_model_(new ToolbarModelImpl(this, content::kMaxURLDisplayChars)), | 25 : toolbar_model_(new ToolbarModelImpl(this, content::kMaxURLDisplayChars)), |
25 weak_java_delegate_(env, jdelegate) {} | 26 weak_java_delegate_(env, jdelegate) {} |
26 | 27 |
27 ToolbarModelAndroid::~ToolbarModelAndroid() { | 28 ToolbarModelAndroid::~ToolbarModelAndroid() { |
28 } | 29 } |
29 | 30 |
30 void ToolbarModelAndroid::Destroy(JNIEnv* env, | 31 void ToolbarModelAndroid::Destroy(JNIEnv* env, |
(...skipping 23 matching lines...) Expand all Loading... |
54 return RegisterNativesImpl(env); | 55 return RegisterNativesImpl(env); |
55 } | 56 } |
56 | 57 |
57 // static | 58 // static |
58 jlong Init(JNIEnv* env, | 59 jlong Init(JNIEnv* env, |
59 const JavaParamRef<jobject>& obj, | 60 const JavaParamRef<jobject>& obj, |
60 const JavaParamRef<jobject>& delegate) { | 61 const JavaParamRef<jobject>& delegate) { |
61 ToolbarModelAndroid* toolbar_model = new ToolbarModelAndroid(env, delegate); | 62 ToolbarModelAndroid* toolbar_model = new ToolbarModelAndroid(env, delegate); |
62 return reinterpret_cast<intptr_t>(toolbar_model); | 63 return reinterpret_cast<intptr_t>(toolbar_model); |
63 } | 64 } |
OLD | NEW |