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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_ANDROID_TOOLBAR_TOOLBAR_MODEL_ANDROID_H_
6 #define CHROME_BROWSER_UI_ANDROID_TOOLBAR_TOOLBAR_MODEL_ANDROID_H_
8 #include "base/android/jni_android.h"
9 #include "base/android/jni_weak_ref.h"
10 #include "base/android/scoped_java_ref.h"
11 #include "base/basictypes.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "chrome/browser/ui/toolbar/toolbar_model.h"
14 #include "chrome/browser/ui/toolbar/toolbar_model_delegate.h"
20 // Owns a ToolbarModel and provides a way for Java to interact with it.
21 class ToolbarModelAndroid
: public ToolbarModelDelegate
{
23 explicit ToolbarModelAndroid(JNIEnv
* env
, jobject jdelegate
);
24 ~ToolbarModelAndroid() override
;
26 void Destroy(JNIEnv
* env
, jobject obj
);
27 base::android::ScopedJavaLocalRef
<jstring
> GetText(
30 base::android::ScopedJavaLocalRef
<jstring
> GetQueryExtractionParam(
33 base::android::ScopedJavaLocalRef
<jstring
> GetCorpusChipText(
38 content::WebContents
* GetActiveWebContents() const override
;
40 static bool RegisterToolbarModelAndroid(JNIEnv
* env
);
43 scoped_ptr
<ToolbarModel
> toolbar_model_
;
44 JavaObjectWeakGlobalRef weak_java_delegate_
;
46 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarModelAndroid
);
49 #endif // CHROME_BROWSER_UI_ANDROID_TOOLBAR_TOOLBAR_MODEL_ANDROID_H_