OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // TestWebViewDelegate class: | 5 // TestWebViewDelegate class: |
6 // This class implements the WebViewDelegate methods for the test shell. One | 6 // This class implements the WebViewDelegate methods for the test shell. One |
7 // instance is owned by each TestShell. | 7 // instance is owned by each TestShell. |
8 | 8 |
9 #ifndef WEBKIT_TOOLS_TEST_SHELL_TEST_WEBVIEW_DELEGATE_H_ | 9 #ifndef WEBKIT_TOOLS_TEST_SHELL_TEST_WEBVIEW_DELEGATE_H_ |
10 #define WEBKIT_TOOLS_TEST_SHELL_TEST_WEBVIEW_DELEGATE_H_ | 10 #define WEBKIT_TOOLS_TEST_SHELL_TEST_WEBVIEW_DELEGATE_H_ |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 virtual void setStatusText(const WebKit::WebString& text); | 134 virtual void setStatusText(const WebKit::WebString& text); |
135 virtual void startDragging( | 135 virtual void startDragging( |
136 const WebKit::WebDragData& data, WebKit::WebDragOperationsMask mask, | 136 const WebKit::WebDragData& data, WebKit::WebDragOperationsMask mask, |
137 const WebKit::WebImage& image, const WebKit::WebPoint& offset); | 137 const WebKit::WebImage& image, const WebKit::WebPoint& offset); |
138 virtual void navigateBackForwardSoon(int offset); | 138 virtual void navigateBackForwardSoon(int offset); |
139 virtual int historyBackListCount(); | 139 virtual int historyBackListCount(); |
140 virtual int historyForwardListCount(); | 140 virtual int historyForwardListCount(); |
141 virtual void focusAccessibilityObject( | 141 virtual void focusAccessibilityObject( |
142 const WebKit::WebAccessibilityObject& object); | 142 const WebKit::WebAccessibilityObject& object); |
143 virtual WebKit::WebNotificationPresenter* notificationPresenter(); | 143 virtual WebKit::WebNotificationPresenter* notificationPresenter(); |
| 144 #if defined(ENABLE_CLIENT_BASED_GEOLOCATION) |
| 145 WebKit::WebGeolocationClient* geolocationClient(); |
| 146 #else |
144 virtual WebKit::WebGeolocationService* geolocationService(); | 147 virtual WebKit::WebGeolocationService* geolocationService(); |
| 148 #endif |
145 virtual WebKit::WebDeviceOrientationClient* deviceOrientationClient(); | 149 virtual WebKit::WebDeviceOrientationClient* deviceOrientationClient(); |
146 virtual WebKit::WebSpeechInputController* speechInputController( | 150 virtual WebKit::WebSpeechInputController* speechInputController( |
147 WebKit::WebSpeechInputListener*); | 151 WebKit::WebSpeechInputListener*); |
148 | 152 |
149 // WebKit::WebWidgetClient | 153 // WebKit::WebWidgetClient |
150 virtual void didInvalidateRect(const WebKit::WebRect& rect); | 154 virtual void didInvalidateRect(const WebKit::WebRect& rect); |
151 virtual void didScrollRect(int dx, int dy, | 155 virtual void didScrollRect(int dx, int dy, |
152 const WebKit::WebRect& clip_rect); | 156 const WebKit::WebRect& clip_rect); |
153 virtual void scheduleComposite(); | 157 virtual void scheduleComposite(); |
154 virtual void didFocus(); | 158 virtual void didFocus(); |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 void SetEditCommand(const std::string& name, const std::string& value) { | 320 void SetEditCommand(const std::string& name, const std::string& value) { |
317 edit_command_name_ = name; | 321 edit_command_name_ = name; |
318 edit_command_value_ = value; | 322 edit_command_value_ = value; |
319 } | 323 } |
320 | 324 |
321 void ClearEditCommand() { | 325 void ClearEditCommand() { |
322 edit_command_name_.clear(); | 326 edit_command_name_.clear(); |
323 edit_command_value_.clear(); | 327 edit_command_value_.clear(); |
324 } | 328 } |
325 | 329 |
| 330 #if !defined(ENABLE_CLIENT_BASED_GEOLOCATION) |
326 void SetGeolocationPermission(bool allowed); | 331 void SetGeolocationPermission(bool allowed); |
| 332 #endif |
327 | 333 |
328 void ClearContextMenuData(); | 334 void ClearContextMenuData(); |
329 | 335 |
330 const WebKit::WebContextMenuData* last_context_menu_data() const { | 336 const WebKit::WebContextMenuData* last_context_menu_data() const { |
331 return last_context_menu_data_.get(); | 337 return last_context_menu_data_.get(); |
332 } | 338 } |
333 | 339 |
334 MockSpellCheck* mock_spellcheck() { | 340 MockSpellCheck* mock_spellcheck() { |
335 return &mock_spellcheck_; | 341 return &mock_spellcheck_; |
336 } | 342 } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 WebWidgetHost* GetWidgetHost(); | 378 WebWidgetHost* GetWidgetHost(); |
373 | 379 |
374 void UpdateForCommittedLoad(WebKit::WebFrame* frame, bool is_new_navigation); | 380 void UpdateForCommittedLoad(WebKit::WebFrame* frame, bool is_new_navigation); |
375 void UpdateURL(WebKit::WebFrame* frame); | 381 void UpdateURL(WebKit::WebFrame* frame); |
376 void UpdateSessionHistory(WebKit::WebFrame* frame); | 382 void UpdateSessionHistory(WebKit::WebFrame* frame); |
377 void UpdateSelectionClipboard(bool is_empty_selection); | 383 void UpdateSelectionClipboard(bool is_empty_selection); |
378 | 384 |
379 // Get a string suitable for dumping a frame to the console. | 385 // Get a string suitable for dumping a frame to the console. |
380 std::wstring GetFrameDescription(WebKit::WebFrame* webframe); | 386 std::wstring GetFrameDescription(WebKit::WebFrame* webframe); |
381 | 387 |
| 388 #if !defined(ENABLE_CLIENT_BASED_GEOLOCATION) |
382 // Returns a TestGeolocationService owned by this delegate. | 389 // Returns a TestGeolocationService owned by this delegate. |
383 TestGeolocationService* GetTestGeolocationService(); | 390 TestGeolocationService* GetTestGeolocationService(); |
| 391 #endif |
384 | 392 |
385 // Causes navigation actions just printout the intended navigation instead | 393 // Causes navigation actions just printout the intended navigation instead |
386 // of taking you to the page. This is used for cases like mailto, where you | 394 // of taking you to the page. This is used for cases like mailto, where you |
387 // don't actually want to open the mail program. | 395 // don't actually want to open the mail program. |
388 bool policy_delegate_enabled_; | 396 bool policy_delegate_enabled_; |
389 | 397 |
390 // Toggles the behavior of the policy delegate. If true, then navigations | 398 // Toggles the behavior of the policy delegate. If true, then navigations |
391 // will be allowed. Otherwise, they will be ignored (dropped). | 399 // will be allowed. Otherwise, they will be ignored (dropped). |
392 bool policy_delegate_is_permissive_; | 400 bool policy_delegate_is_permissive_; |
393 | 401 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 // true if we should block (set an empty request for) any requests | 460 // true if we should block (set an empty request for) any requests |
453 bool request_return_null_; | 461 bool request_return_null_; |
454 | 462 |
455 // Edit command associated to the current keyboard event. | 463 // Edit command associated to the current keyboard event. |
456 std::string edit_command_name_; | 464 std::string edit_command_name_; |
457 std::string edit_command_value_; | 465 std::string edit_command_value_; |
458 | 466 |
459 // The mock spellchecker used in TestWebViewDelegate::spellCheck(). | 467 // The mock spellchecker used in TestWebViewDelegate::spellCheck(). |
460 MockSpellCheck mock_spellcheck_; | 468 MockSpellCheck mock_spellcheck_; |
461 | 469 |
| 470 #if !defined(ENABLE_CLIENT_BASED_GEOLOCATION) |
462 scoped_ptr<TestGeolocationService> test_geolocation_service_; | 471 scoped_ptr<TestGeolocationService> test_geolocation_service_; |
| 472 #endif |
463 | 473 |
464 DISALLOW_COPY_AND_ASSIGN(TestWebViewDelegate); | 474 DISALLOW_COPY_AND_ASSIGN(TestWebViewDelegate); |
465 }; | 475 }; |
466 | 476 |
467 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_WEBVIEW_DELEGATE_H_ | 477 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_WEBVIEW_DELEGATE_H_ |
OLD | NEW |