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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/chrome_web_contents_delegate_android.h
diff --git a/chrome/browser/android/chrome_web_contents_delegate_android.h b/chrome/browser/android/chrome_web_contents_delegate_android.h
index beba28fa73f104fe51fd3f8d583df8b65e7e275d..43bfbe2a94bab7d04e97399858b74fe8b8413722 100644
--- a/chrome/browser/android/chrome_web_contents_delegate_android.h
+++ b/chrome/browser/android/chrome_web_contents_delegate_android.h
@@ -8,12 +8,22 @@
#include <jni.h>
#include "chrome/browser/component/web_contents_delegate_android/web_contents_delegate_android.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
+
+class FindMatchRectsDetails;
+class FindNotificationDetails;
namespace content {
struct FileChooserParams;
class WebContents;
}
+namespace gfx {
+class Rect;
+class RectF;
+}
+
namespace chrome {
namespace android {
@@ -21,7 +31,8 @@ namespace android {
// Should contain any WebContentsDelegate implementations required by
// the Chromium Android port but not to be shared with WebView.
class ChromeWebContentsDelegateAndroid
- : public web_contents_delegate_android::WebContentsDelegateAndroid {
+ : public web_contents_delegate_android::WebContentsDelegateAndroid,
+ public content::NotificationObserver {
public:
ChromeWebContentsDelegateAndroid(JNIEnv* env, jobject obj);
virtual ~ChromeWebContentsDelegateAndroid();
@@ -29,8 +40,39 @@ class ChromeWebContentsDelegateAndroid
virtual void RunFileChooser(content::WebContents* web_contents,
const content::FileChooserParams& params)
OVERRIDE;
+
+ virtual void CloseContents(content::WebContents* web_contents) OVERRIDE;
+
jam 2012/09/04 16:39:09 nit: no blank lines between overridden methods
Leandro GraciĆ” Gil 2012/09/04 18:25:50 Done.
+
+ virtual void FindReply(content::WebContents* web_contents,
+ int request_id,
+ int number_of_matches,
+ const gfx::Rect& selection_rect,
+ int active_match_ordinal,
+ bool final_update) OVERRIDE;
+
+ virtual void GetFindMatchRectsReply(content::WebContents* web_contents,
+ int version,
+ const std::vector<gfx::RectF>& rects,
+ const gfx::RectF& active_rect) OVERRIDE;
+
+ private:
+ // NotificationObserver implementation.
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
+
+ void OnFindResultAvailable(content::WebContents* web_contents,
+ const FindNotificationDetails* find_result);
+ void OnFindMatchRectsAvailable(content::WebContents* web_contents,
+ const FindMatchRectsDetails* match_rects);
+
+ content::NotificationRegistrar notification_registrar_;
};
+// Register the native methods through JNI.
+bool RegisterChromeWebContentsDelegateAndroid(JNIEnv* env);
+
} // namespace android
} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698