OLD | NEW |
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 "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // Should contain any WebContentsDelegate implementations required by | 31 // Should contain any WebContentsDelegate implementations required by |
32 // the Chromium Android port but not to be shared with WebView. | 32 // the Chromium Android port but not to be shared with WebView. |
33 class ChromeWebContentsDelegateAndroid | 33 class ChromeWebContentsDelegateAndroid |
34 : public web_contents_delegate_android::WebContentsDelegateAndroid, | 34 : public web_contents_delegate_android::WebContentsDelegateAndroid, |
35 public content::NotificationObserver { | 35 public content::NotificationObserver { |
36 public: | 36 public: |
37 ChromeWebContentsDelegateAndroid(JNIEnv* env, jobject obj); | 37 ChromeWebContentsDelegateAndroid(JNIEnv* env, jobject obj); |
38 virtual ~ChromeWebContentsDelegateAndroid(); | 38 virtual ~ChromeWebContentsDelegateAndroid(); |
39 | 39 |
40 virtual void LoadingStateChanged(content::WebContents* source, | 40 virtual void LoadingStateChanged(content::WebContents* source, |
41 bool to_different_document) OVERRIDE; | 41 bool to_different_document) override; |
42 virtual void RunFileChooser(content::WebContents* web_contents, | 42 virtual void RunFileChooser(content::WebContents* web_contents, |
43 const content::FileChooserParams& params) | 43 const content::FileChooserParams& params) |
44 OVERRIDE; | 44 override; |
45 virtual void CloseContents(content::WebContents* web_contents) OVERRIDE; | 45 virtual void CloseContents(content::WebContents* web_contents) override; |
46 virtual void FindReply(content::WebContents* web_contents, | 46 virtual void FindReply(content::WebContents* web_contents, |
47 int request_id, | 47 int request_id, |
48 int number_of_matches, | 48 int number_of_matches, |
49 const gfx::Rect& selection_rect, | 49 const gfx::Rect& selection_rect, |
50 int active_match_ordinal, | 50 int active_match_ordinal, |
51 bool final_update) OVERRIDE; | 51 bool final_update) override; |
52 virtual void FindMatchRectsReply(content::WebContents* web_contents, | 52 virtual void FindMatchRectsReply(content::WebContents* web_contents, |
53 int version, | 53 int version, |
54 const std::vector<gfx::RectF>& rects, | 54 const std::vector<gfx::RectF>& rects, |
55 const gfx::RectF& active_rect) OVERRIDE; | 55 const gfx::RectF& active_rect) override; |
56 virtual content::JavaScriptDialogManager* | 56 virtual content::JavaScriptDialogManager* |
57 GetJavaScriptDialogManager() OVERRIDE; | 57 GetJavaScriptDialogManager() override; |
58 virtual void RequestMediaAccessPermission( | 58 virtual void RequestMediaAccessPermission( |
59 content::WebContents* web_contents, | 59 content::WebContents* web_contents, |
60 const content::MediaStreamRequest& request, | 60 const content::MediaStreamRequest& request, |
61 const content::MediaResponseCallback& callback) OVERRIDE; | 61 const content::MediaResponseCallback& callback) override; |
62 virtual bool CheckMediaAccessPermission( | 62 virtual bool CheckMediaAccessPermission( |
63 content::WebContents* web_contents, | 63 content::WebContents* web_contents, |
64 const GURL& security_origin, | 64 const GURL& security_origin, |
65 content::MediaStreamType type) OVERRIDE; | 65 content::MediaStreamType type) override; |
66 virtual bool RequestPpapiBrokerPermission( | 66 virtual bool RequestPpapiBrokerPermission( |
67 content::WebContents* web_contents, | 67 content::WebContents* web_contents, |
68 const GURL& url, | 68 const GURL& url, |
69 const base::FilePath& plugin_path, | 69 const base::FilePath& plugin_path, |
70 const base::Callback<void(bool)>& callback) OVERRIDE; | 70 const base::Callback<void(bool)>& callback) override; |
71 virtual content::WebContents* OpenURLFromTab( | 71 virtual content::WebContents* OpenURLFromTab( |
72 content::WebContents* source, | 72 content::WebContents* source, |
73 const content::OpenURLParams& params) OVERRIDE; | 73 const content::OpenURLParams& params) override; |
74 virtual void AddNewContents(content::WebContents* source, | 74 virtual void AddNewContents(content::WebContents* source, |
75 content::WebContents* new_contents, | 75 content::WebContents* new_contents, |
76 WindowOpenDisposition disposition, | 76 WindowOpenDisposition disposition, |
77 const gfx::Rect& initial_pos, | 77 const gfx::Rect& initial_pos, |
78 bool user_gesture, | 78 bool user_gesture, |
79 bool* was_blocked) OVERRIDE; | 79 bool* was_blocked) override; |
80 virtual void WebContentsCreated(content::WebContents* source_contents, | 80 virtual void WebContentsCreated(content::WebContents* source_contents, |
81 int opener_render_frame_id, | 81 int opener_render_frame_id, |
82 const base::string16& frame_name, | 82 const base::string16& frame_name, |
83 const GURL& target_url, | 83 const GURL& target_url, |
84 content::WebContents* new_contents) OVERRIDE; | 84 content::WebContents* new_contents) override; |
85 private: | 85 private: |
86 // NotificationObserver implementation. | 86 // NotificationObserver implementation. |
87 virtual void Observe(int type, | 87 virtual void Observe(int type, |
88 const content::NotificationSource& source, | 88 const content::NotificationSource& source, |
89 const content::NotificationDetails& details) OVERRIDE; | 89 const content::NotificationDetails& details) override; |
90 | 90 |
91 void OnFindResultAvailable(content::WebContents* web_contents, | 91 void OnFindResultAvailable(content::WebContents* web_contents, |
92 const FindNotificationDetails* find_result); | 92 const FindNotificationDetails* find_result); |
93 | 93 |
94 content::NotificationRegistrar notification_registrar_; | 94 content::NotificationRegistrar notification_registrar_; |
95 }; | 95 }; |
96 | 96 |
97 // Register the native methods through JNI. | 97 // Register the native methods through JNI. |
98 bool RegisterChromeWebContentsDelegateAndroid(JNIEnv* env); | 98 bool RegisterChromeWebContentsDelegateAndroid(JNIEnv* env); |
99 | 99 |
100 } // namespace android | 100 } // namespace android |
101 } // namespace chrome | 101 } // namespace chrome |
102 | 102 |
103 #endif // CHROME_BROWSER_ANDROID_CHROME_WEB_CONTENTS_DELEGATE_ANDROID_H_ | 103 #endif // CHROME_BROWSER_ANDROID_CHROME_WEB_CONTENTS_DELEGATE_ANDROID_H_ |
OLD | NEW |