| 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 #ifndef CHROME_BROWSER_UI_ANDROID_TOOLBAR_TOOLBAR_MODEL_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_UI_ANDROID_TOOLBAR_TOOLBAR_MODEL_ANDROID_H_ |
| 6 #define CHROME_BROWSER_UI_ANDROID_TOOLBAR_TOOLBAR_MODEL_ANDROID_H_ | 6 #define CHROME_BROWSER_UI_ANDROID_TOOLBAR_TOOLBAR_MODEL_ANDROID_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // Owns a ToolbarModel and provides a way for Java to interact with it. | 21 // Owns a ToolbarModel and provides a way for Java to interact with it. |
| 22 class ToolbarModelAndroid : public ChromeToolbarModelDelegate { | 22 class ToolbarModelAndroid : public ChromeToolbarModelDelegate { |
| 23 public: | 23 public: |
| 24 explicit ToolbarModelAndroid(JNIEnv* env, jobject jdelegate); | 24 explicit ToolbarModelAndroid(JNIEnv* env, jobject jdelegate); |
| 25 ~ToolbarModelAndroid() override; | 25 ~ToolbarModelAndroid() override; |
| 26 | 26 |
| 27 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 27 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 28 base::android::ScopedJavaLocalRef<jstring> GetText( | 28 base::android::ScopedJavaLocalRef<jstring> GetText( |
| 29 JNIEnv* env, | 29 JNIEnv* env, |
| 30 const base::android::JavaParamRef<jobject>& obj); | 30 const base::android::JavaParamRef<jobject>& obj); |
| 31 base::android::ScopedJavaLocalRef<jstring> GetCorpusChipText( | |
| 32 JNIEnv* env, | |
| 33 const base::android::JavaParamRef<jobject>& obj); | |
| 34 jboolean WouldReplaceURL(JNIEnv* env, | |
| 35 const base::android::JavaParamRef<jobject>& obj); | |
| 36 | 31 |
| 37 // ChromeToolbarModelDelegate: | 32 // ChromeToolbarModelDelegate: |
| 38 content::WebContents* GetActiveWebContents() const override; | 33 content::WebContents* GetActiveWebContents() const override; |
| 39 | 34 |
| 40 static bool RegisterToolbarModelAndroid(JNIEnv* env); | 35 static bool RegisterToolbarModelAndroid(JNIEnv* env); |
| 41 | 36 |
| 42 private: | 37 private: |
| 43 std::unique_ptr<ToolbarModel> toolbar_model_; | 38 std::unique_ptr<ToolbarModel> toolbar_model_; |
| 44 JavaObjectWeakGlobalRef weak_java_delegate_; | 39 JavaObjectWeakGlobalRef weak_java_delegate_; |
| 45 | 40 |
| 46 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarModelAndroid); | 41 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarModelAndroid); |
| 47 }; | 42 }; |
| 48 | 43 |
| 49 #endif // CHROME_BROWSER_UI_ANDROID_TOOLBAR_TOOLBAR_MODEL_ANDROID_H_ | 44 #endif // CHROME_BROWSER_UI_ANDROID_TOOLBAR_TOOLBAR_MODEL_ANDROID_H_ |
| OLD | NEW |