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