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