| OLD | NEW |
| 1 // Copyright (c) 2007-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2007-2009 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 #include "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "AXObjectCache.h" | 7 #include "AXObjectCache.h" |
| 8 #include "CSSStyleSelector.h" | 8 #include "CSSStyleSelector.h" |
| 9 #include "CSSValueKeywords.h" | 9 #include "CSSValueKeywords.h" |
| 10 #include "Cursor.h" | 10 #include "Cursor.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 #include "webkit/glue/webkit_glue.h" | 74 #include "webkit/glue/webkit_glue.h" |
| 75 #include "webkit/glue/webpopupmenu_impl.h" | 75 #include "webkit/glue/webpopupmenu_impl.h" |
| 76 #include "webkit/glue/webview_impl.h" | 76 #include "webkit/glue/webview_impl.h" |
| 77 | 77 |
| 78 // Get rid of WTF's pow define so we can use std::pow. | 78 // Get rid of WTF's pow define so we can use std::pow. |
| 79 #undef pow | 79 #undef pow |
| 80 #include <cmath> // for std::pow | 80 #include <cmath> // for std::pow |
| 81 | 81 |
| 82 using namespace WebCore; | 82 using namespace WebCore; |
| 83 | 83 |
| 84 using WebKit::EditorClientImpl; |
| 84 using WebKit::PlatformKeyboardEventBuilder; | 85 using WebKit::PlatformKeyboardEventBuilder; |
| 85 using WebKit::PlatformMouseEventBuilder; | 86 using WebKit::PlatformMouseEventBuilder; |
| 86 using WebKit::PlatformWheelEventBuilder; | 87 using WebKit::PlatformWheelEventBuilder; |
| 87 using WebKit::WebAccessibilityObject; | 88 using WebKit::WebAccessibilityObject; |
| 88 using WebKit::WebCanvas; | 89 using WebKit::WebCanvas; |
| 89 using WebKit::WebCompositionCommand; | 90 using WebKit::WebCompositionCommand; |
| 90 using WebKit::WebCompositionCommandConfirm; | 91 using WebKit::WebCompositionCommandConfirm; |
| 91 using WebKit::WebCompositionCommandDiscard; | 92 using WebKit::WebCompositionCommandDiscard; |
| 92 using WebKit::WebDevToolsAgent; | 93 using WebKit::WebDevToolsAgent; |
| 93 using WebKit::WebDevToolsAgentClient; | 94 using WebKit::WebDevToolsAgentClient; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 | 184 |
| 184 virtual ~AutocompletePopupMenuClient() { | 185 virtual ~AutocompletePopupMenuClient() { |
| 185 } | 186 } |
| 186 | 187 |
| 187 // WebCore::PopupMenuClient implementation. | 188 // WebCore::PopupMenuClient implementation. |
| 188 virtual void valueChanged(unsigned listIndex, bool fireEvents = true) { | 189 virtual void valueChanged(unsigned listIndex, bool fireEvents = true) { |
| 189 text_field_->setValue(suggestions_[listIndex]); | 190 text_field_->setValue(suggestions_[listIndex]); |
| 190 EditorClientImpl* editor = | 191 EditorClientImpl* editor = |
| 191 static_cast<EditorClientImpl*>(webview_->page()->editorClient()); | 192 static_cast<EditorClientImpl*>(webview_->page()->editorClient()); |
| 192 ASSERT(editor); | 193 ASSERT(editor); |
| 193 editor->OnAutofillSuggestionAccepted( | 194 editor->onAutofillSuggestionAccepted( |
| 194 static_cast<WebCore::HTMLInputElement*>(text_field_.get())); | 195 static_cast<WebCore::HTMLInputElement*>(text_field_.get())); |
| 195 } | 196 } |
| 196 | 197 |
| 197 virtual WebCore::String itemText(unsigned list_index) const { | 198 virtual WebCore::String itemText(unsigned list_index) const { |
| 198 return suggestions_[list_index]; | 199 return suggestions_[list_index]; |
| 199 } | 200 } |
| 200 | 201 |
| 201 virtual WebCore::String itemToolTip(unsigned last_index) const { | 202 virtual WebCore::String itemToolTip(unsigned last_index) const { |
| 202 notImplemented(); | 203 notImplemented(); |
| 203 return WebCore::String(); | 204 return WebCore::String(); |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 } | 492 } |
| 492 } | 493 } |
| 493 } | 494 } |
| 494 | 495 |
| 495 main_frame()->frame()->eventHandler()->handleMousePressEvent( | 496 main_frame()->frame()->eventHandler()->handleMousePressEvent( |
| 496 PlatformMouseEventBuilder(main_frame()->frameview(), event)); | 497 PlatformMouseEventBuilder(main_frame()->frameview(), event)); |
| 497 | 498 |
| 498 if (clicked_node.get() && clicked_node == GetFocusedNode()) { | 499 if (clicked_node.get() && clicked_node == GetFocusedNode()) { |
| 499 // Focus has not changed, show the autocomplete popup. | 500 // Focus has not changed, show the autocomplete popup. |
| 500 static_cast<EditorClientImpl*>(page_->editorClient())-> | 501 static_cast<EditorClientImpl*>(page_->editorClient())-> |
| 501 ShowFormAutofillForNode(clicked_node.get()); | 502 showFormAutofillForNode(clicked_node.get()); |
| 502 } | 503 } |
| 503 | 504 |
| 504 // Dispatch the contextmenu event regardless of if the click was swallowed. | 505 // Dispatch the contextmenu event regardless of if the click was swallowed. |
| 505 // On Windows, we handle it on mouse up, not down. | 506 // On Windows, we handle it on mouse up, not down. |
| 506 #if PLATFORM(DARWIN) | 507 #if PLATFORM(DARWIN) |
| 507 if (event.button == WebMouseEvent::ButtonRight || | 508 if (event.button == WebMouseEvent::ButtonRight || |
| 508 (event.button == WebMouseEvent::ButtonLeft && | 509 (event.button == WebMouseEvent::ButtonLeft && |
| 509 event.modifiers & WebMouseEvent::ControlKey)) { | 510 event.modifiers & WebMouseEvent::ControlKey)) { |
| 510 MouseContextMenu(event); | 511 MouseContextMenu(event); |
| 511 } | 512 } |
| (...skipping 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1911 hitTestResultAtPoint(doc_point, false); | 1912 hitTestResultAtPoint(doc_point, false); |
| 1912 } | 1913 } |
| 1913 | 1914 |
| 1914 void WebViewImpl::setTabsToLinks(bool enable) { | 1915 void WebViewImpl::setTabsToLinks(bool enable) { |
| 1915 tabs_to_links_ = enable; | 1916 tabs_to_links_ = enable; |
| 1916 } | 1917 } |
| 1917 | 1918 |
| 1918 bool WebViewImpl::tabsToLinks() const { | 1919 bool WebViewImpl::tabsToLinks() const { |
| 1919 return tabs_to_links_; | 1920 return tabs_to_links_; |
| 1920 } | 1921 } |
| OLD | NEW |