OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ |
6 #define EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
11 #include "content/public/browser/javascript_dialog_manager.h" | 11 #include "content/public/browser/javascript_dialog_manager.h" |
12 #include "content/public/browser/notification_observer.h" | 12 #include "content/public/browser/notification_observer.h" |
13 #include "content/public/browser/notification_registrar.h" | 13 #include "content/public/browser/notification_registrar.h" |
14 #include "extensions/browser/guest_view/guest_view.h" | 14 #include "extensions/browser/guest_view/guest_view.h" |
15 #include "extensions/browser/guest_view/web_view/javascript_dialog_helper.h" | 15 #include "extensions/browser/guest_view/web_view/javascript_dialog_helper.h" |
16 #include "extensions/browser/guest_view/web_view/web_view_find_helper.h" | |
16 #include "extensions/browser/guest_view/web_view/web_view_guest_delegate.h" | 17 #include "extensions/browser/guest_view/web_view/web_view_guest_delegate.h" |
17 #include "extensions/browser/guest_view/web_view/web_view_permission_helper.h" | 18 #include "extensions/browser/guest_view/web_view/web_view_permission_helper.h" |
18 #include "extensions/browser/guest_view/web_view/web_view_permission_types.h" | 19 #include "extensions/browser/guest_view/web_view/web_view_permission_types.h" |
19 #include "extensions/browser/script_executor.h" | 20 #include "extensions/browser/script_executor.h" |
20 | 21 |
21 namespace blink { | 22 namespace blink { |
22 struct WebFindOptions; | 23 struct WebFindOptions; |
23 } // nanespace blink | 24 } // nanespace blink |
24 | 25 |
25 namespace extensions { | 26 namespace extensions { |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
155 const base::Callback<void(bool)>& callback) OVERRIDE; | 156 const base::Callback<void(bool)>& callback) OVERRIDE; |
156 // NotificationObserver implementation. | 157 // NotificationObserver implementation. |
157 virtual void Observe(int type, | 158 virtual void Observe(int type, |
158 const content::NotificationSource& source, | 159 const content::NotificationSource& source, |
159 const content::NotificationDetails& details) OVERRIDE; | 160 const content::NotificationDetails& details) OVERRIDE; |
160 | 161 |
161 // Returns the current zoom factor. | 162 // Returns the current zoom factor. |
162 double GetZoom(); | 163 double GetZoom(); |
163 | 164 |
164 // Begin or continue a find request. | 165 // Begin or continue a find request. |
165 void Find( | 166 void Find(const base::string16& search_text, |
166 const base::string16& search_text, | 167 const blink::WebFindOptions& options, |
167 const blink::WebFindOptions& options, | 168 WebViewInternalFindFunction* find_function); |
Fady Samuel
2014/09/18 16:49:48
Can we restore this back to being a scoped_refptr?
| |
168 WebViewInternalFindFunction* find_function); | |
169 | 169 |
170 // Conclude a find request to clear highlighting. | 170 // Conclude a find request to clear highlighting. |
171 void StopFinding(content::StopFindAction); | 171 void StopFinding(content::StopFindAction); |
172 | 172 |
173 // If possible, navigate the guest to |relative_index| entries away from the | 173 // If possible, navigate the guest to |relative_index| entries away from the |
174 // current navigation entry. | 174 // current navigation entry. |
175 void Go(int relative_index); | 175 void Go(int relative_index); |
176 | 176 |
177 // Reload the guest. | 177 // Reload the guest. |
178 void Reload(); | 178 void Reload(); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
305 // Creates a new guest window owned by this WebViewGuest. | 305 // Creates a new guest window owned by this WebViewGuest. |
306 void CreateNewGuestWebViewWindow(const content::OpenURLParams& params); | 306 void CreateNewGuestWebViewWindow(const content::OpenURLParams& params); |
307 | 307 |
308 void NewGuestWebViewCallback(const content::OpenURLParams& params, | 308 void NewGuestWebViewCallback(const content::OpenURLParams& params, |
309 content::WebContents* guest_web_contents); | 309 content::WebContents* guest_web_contents); |
310 | 310 |
311 bool HandleKeyboardShortcuts(const content::NativeWebKeyboardEvent& event); | 311 bool HandleKeyboardShortcuts(const content::NativeWebKeyboardEvent& event); |
312 | 312 |
313 void SetUpAutoSize(); | 313 void SetUpAutoSize(); |
314 | 314 |
315 // Handles find requests and replies for the webview find API. | |
316 WebViewFindHelper find_helper_; | |
317 | |
315 ObserverList<ScriptExecutionObserver> script_observers_; | 318 ObserverList<ScriptExecutionObserver> script_observers_; |
316 scoped_ptr<ScriptExecutor> script_executor_; | 319 scoped_ptr<ScriptExecutor> script_executor_; |
317 | 320 |
318 content::NotificationRegistrar notification_registrar_; | 321 content::NotificationRegistrar notification_registrar_; |
319 | 322 |
320 // True if the user agent is overridden. | 323 // True if the user agent is overridden. |
321 bool is_overriding_user_agent_; | 324 bool is_overriding_user_agent_; |
322 | 325 |
323 // Stores the window name of the main frame of the guest. | 326 // Stores the window name of the main frame of the guest. |
324 std::string name_; | 327 std::string name_; |
(...skipping 20 matching lines...) Expand all Loading... | |
345 | 348 |
346 typedef std::map<WebViewGuest*, NewWindowInfo> PendingWindowMap; | 349 typedef std::map<WebViewGuest*, NewWindowInfo> PendingWindowMap; |
347 PendingWindowMap pending_new_windows_; | 350 PendingWindowMap pending_new_windows_; |
348 | 351 |
349 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); | 352 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); |
350 }; | 353 }; |
351 | 354 |
352 } // namespace extensions | 355 } // namespace extensions |
353 | 356 |
354 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 357 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ |
OLD | NEW |