Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: blimp/client/app/android/toolbar.h

Issue 2542083004: Make //blimp/client/app a real embedder of //blimp/client/public (Closed)
Patch Set: Fix findbugs issue Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 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.
4
5 #ifndef BLIMP_CLIENT_APP_ANDROID_TOOLBAR_H_
6 #define BLIMP_CLIENT_APP_ANDROID_TOOLBAR_H_
7
8 #include <string>
9
10 #include "base/android/jni_android.h"
11 #include "base/macros.h"
12 #include "blimp/client/core/contents/navigation_feature.h"
13
14 class GURL;
15 class SkBitmap;
16
17 namespace blimp {
18 namespace client {
19
20 // The native component of org.chromium.blimp.toolbar.Toolbar. This handles
21 // marshalling calls between Java and native. Specifically, this passes calls
22 // between Toolbar.java <=> NavigationFeature.
23 class Toolbar : public NavigationFeature::NavigationFeatureDelegate {
24 public:
25 static bool RegisterJni(JNIEnv* env);
26
27 Toolbar(JNIEnv* env,
28 const base::android::JavaParamRef<jobject>& jobj,
29 NavigationFeature* navigation_feature);
30
31 // Methods called from Java via JNI.
32 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& jobj);
33 void OnUrlTextEntered(JNIEnv* env,
34 const base::android::JavaParamRef<jobject>& jobj,
35 const base::android::JavaParamRef<jstring>& text);
36 void OnReloadPressed(JNIEnv* env,
37 const base::android::JavaParamRef<jobject>& jobj);
38 void OnForwardPressed(JNIEnv* env,
39 const base::android::JavaParamRef<jobject>& jobj);
40 jboolean OnBackPressed(JNIEnv* env,
41 const base::android::JavaParamRef<jobject>& jobj);
42
43 // NavigationFeatureDelegate implementation.
44 void OnUrlChanged(int tab_id, const GURL& url) override;
45 void OnFaviconChanged(int tab_id, const SkBitmap& favicon) override;
46 void OnTitleChanged(int tab_id, const std::string& title) override;
47 void OnLoadingChanged(int tab_id, bool loading) override;
48 void OnPageLoadStatusUpdate(int tab_id, bool completed) override;
49
50 private:
51 ~Toolbar() override;
52
53 // A bridge to the network layer which does the work of (de)serializing the
54 // outgoing and incoming navigation messages from the engine. Toolbar does not
55 // own this and it is expected to outlive this Toolbar instance.
56 NavigationFeature* navigation_feature_;
57
58 // Reference to the Java object which owns this class.
59 base::android::ScopedJavaGlobalRef<jobject> java_obj_;
60
61 DISALLOW_COPY_AND_ASSIGN(Toolbar);
62 };
63
64 } // namespace client
65 } // namespace blimp
66
67 #endif // BLIMP_CLIENT_APP_ANDROID_TOOLBAR_H_
OLDNEW
« no previous file with comments | « blimp/client/app/android/tab_control_feature_android.cc ('k') | blimp/client/app/android/toolbar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698