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

Side by Side Diff: chrome/browser/android/chrome_web_contents_delegate_android.h

Issue 10905058: Upstream the Android port find-in-page feature. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit fixes. Created 8 years, 3 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_ANDROID_CHROME_WEB_CONTENTS_DELEGATE_ANDROID_H_ 5 #ifndef CHROME_BROWSER_ANDROID_CHROME_WEB_CONTENTS_DELEGATE_ANDROID_H_
6 #define CHROME_BROWSER_ANDROID_CHROME_WEB_CONTENTS_DELEGATE_ANDROID_H_ 6 #define CHROME_BROWSER_ANDROID_CHROME_WEB_CONTENTS_DELEGATE_ANDROID_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 9
10 #include "chrome/browser/component/web_contents_delegate_android/web_contents_de legate_android.h" 10 #include "chrome/browser/component/web_contents_delegate_android/web_contents_de legate_android.h"
11 #include "content/public/browser/notification_observer.h"
12 #include "content/public/browser/notification_registrar.h"
13
14 class FindNotificationDetails;
11 15
12 namespace content { 16 namespace content {
13 struct FileChooserParams; 17 struct FileChooserParams;
14 class WebContents; 18 class WebContents;
15 } 19 }
16 20
21 namespace gfx {
22 class Rect;
23 class RectF;
24 }
25
17 namespace chrome { 26 namespace chrome {
18 namespace android { 27 namespace android {
19 28
20 // Chromium Android specific WebContentsDelegate. 29 // Chromium Android specific WebContentsDelegate.
21 // Should contain any WebContentsDelegate implementations required by 30 // Should contain any WebContentsDelegate implementations required by
22 // the Chromium Android port but not to be shared with WebView. 31 // the Chromium Android port but not to be shared with WebView.
23 class ChromeWebContentsDelegateAndroid 32 class ChromeWebContentsDelegateAndroid
24 : public web_contents_delegate_android::WebContentsDelegateAndroid { 33 : public web_contents_delegate_android::WebContentsDelegateAndroid,
34 public content::NotificationObserver {
25 public: 35 public:
26 ChromeWebContentsDelegateAndroid(JNIEnv* env, jobject obj); 36 ChromeWebContentsDelegateAndroid(JNIEnv* env, jobject obj);
27 virtual ~ChromeWebContentsDelegateAndroid(); 37 virtual ~ChromeWebContentsDelegateAndroid();
28 38
29 virtual void RunFileChooser(content::WebContents* web_contents, 39 virtual void RunFileChooser(content::WebContents* web_contents,
30 const content::FileChooserParams& params) 40 const content::FileChooserParams& params)
31 OVERRIDE; 41 OVERRIDE;
42 virtual void CloseContents(content::WebContents* web_contents) OVERRIDE;
43 virtual void FindReply(content::WebContents* web_contents,
44 int request_id,
45 int number_of_matches,
46 const gfx::Rect& selection_rect,
47 int active_match_ordinal,
48 bool final_update) OVERRIDE;
49 virtual void FindMatchRectsReply(content::WebContents* web_contents,
50 int version,
51 const std::vector<gfx::RectF>& rects,
52 const gfx::RectF& active_rect) OVERRIDE;
53
54 private:
55 // NotificationObserver implementation.
56 virtual void Observe(int type,
57 const content::NotificationSource& source,
58 const content::NotificationDetails& details) OVERRIDE;
59
60 void OnFindResultAvailable(content::WebContents* web_contents,
61 const FindNotificationDetails* find_result);
62
63 content::NotificationRegistrar notification_registrar_;
32 }; 64 };
33 65
66 // Register the native methods through JNI.
67 bool RegisterChromeWebContentsDelegateAndroid(JNIEnv* env);
68
34 } // namespace android 69 } // namespace android
35 } // namespace chrome 70 } // namespace chrome
36 71
37 #endif // CHROME_BROWSER_ANDROID_CHROME_WEB_CONTENTS_DELEGATE_ANDROID_H_ 72 #endif // CHROME_BROWSER_ANDROID_CHROME_WEB_CONTENTS_DELEGATE_ANDROID_H_
OLDNEW
« no previous file with comments | « chrome/browser/android/chrome_jni_registrar.cc ('k') | chrome/browser/android/chrome_web_contents_delegate_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698