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

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: 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 FindMatchRectsDetails;
15 class FindNotificationDetails;
11 16
12 namespace content { 17 namespace content {
13 struct FileChooserParams; 18 struct FileChooserParams;
14 class WebContents; 19 class WebContents;
15 } 20 }
16 21
22 namespace gfx {
23 class Rect;
24 class RectF;
25 }
26
17 namespace chrome { 27 namespace chrome {
18 namespace android { 28 namespace android {
19 29
20 // Chromium Android specific WebContentsDelegate. 30 // Chromium Android specific WebContentsDelegate.
21 // Should contain any WebContentsDelegate implementations required by 31 // Should contain any WebContentsDelegate implementations required by
22 // the Chromium Android port but not to be shared with WebView. 32 // the Chromium Android port but not to be shared with WebView.
23 class ChromeWebContentsDelegateAndroid 33 class ChromeWebContentsDelegateAndroid
24 : public web_contents_delegate_android::WebContentsDelegateAndroid { 34 : public web_contents_delegate_android::WebContentsDelegateAndroid,
35 public content::NotificationObserver {
25 public: 36 public:
26 ChromeWebContentsDelegateAndroid(JNIEnv* env, jobject obj); 37 ChromeWebContentsDelegateAndroid(JNIEnv* env, jobject obj);
27 virtual ~ChromeWebContentsDelegateAndroid(); 38 virtual ~ChromeWebContentsDelegateAndroid();
28 39
29 virtual void RunFileChooser(content::WebContents* web_contents, 40 virtual void RunFileChooser(content::WebContents* web_contents,
30 const content::FileChooserParams& params) 41 const content::FileChooserParams& params)
31 OVERRIDE; 42 OVERRIDE;
43
44 virtual void CloseContents(content::WebContents* web_contents) OVERRIDE;
45
jam 2012/09/04 16:39:09 nit: no blank lines between overridden methods
Leandro GraciĆ” Gil 2012/09/04 18:25:50 Done.
46
47 virtual void FindReply(content::WebContents* web_contents,
48 int request_id,
49 int number_of_matches,
50 const gfx::Rect& selection_rect,
51 int active_match_ordinal,
52 bool final_update) OVERRIDE;
53
54 virtual void GetFindMatchRectsReply(content::WebContents* web_contents,
55 int version,
56 const std::vector<gfx::RectF>& rects,
57 const gfx::RectF& active_rect) OVERRIDE;
58
59 private:
60 // NotificationObserver implementation.
61 virtual void Observe(int type,
62 const content::NotificationSource& source,
63 const content::NotificationDetails& details) OVERRIDE;
64
65 void OnFindResultAvailable(content::WebContents* web_contents,
66 const FindNotificationDetails* find_result);
67 void OnFindMatchRectsAvailable(content::WebContents* web_contents,
68 const FindMatchRectsDetails* match_rects);
69
70 content::NotificationRegistrar notification_registrar_;
32 }; 71 };
33 72
73 // Register the native methods through JNI.
74 bool RegisterChromeWebContentsDelegateAndroid(JNIEnv* env);
75
34 } // namespace android 76 } // namespace android
35 } // namespace chrome 77 } // namespace chrome
36 78
37 #endif // CHROME_BROWSER_ANDROID_CHROME_WEB_CONTENTS_DELEGATE_ANDROID_H_ 79 #endif // CHROME_BROWSER_ANDROID_CHROME_WEB_CONTENTS_DELEGATE_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698