| 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 #include "build/build_config.h" | 6 #include "build/build_config.h" |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 MSVC_PUSH_WARNING_LEVEL(0); | 9 MSVC_PUSH_WARNING_LEVEL(0); |
| 10 #include "CSSStyleSelector.h" | 10 #include "CSSStyleSelector.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 #undef pow | 93 #undef pow |
| 94 #include <cmath> // for std::pow | 94 #include <cmath> // for std::pow |
| 95 | 95 |
| 96 using namespace WebCore; | 96 using namespace WebCore; |
| 97 | 97 |
| 98 using WebKit::WebCanvas; | 98 using WebKit::WebCanvas; |
| 99 using WebKit::WebCompositionCommand; | 99 using WebKit::WebCompositionCommand; |
| 100 using WebKit::WebCompositionCommandConfirm; | 100 using WebKit::WebCompositionCommandConfirm; |
| 101 using WebKit::WebCompositionCommandDiscard; | 101 using WebKit::WebCompositionCommandDiscard; |
| 102 using WebKit::WebDragData; | 102 using WebKit::WebDragData; |
| 103 using WebKit::WebFrame; |
| 103 using WebKit::WebInputEvent; | 104 using WebKit::WebInputEvent; |
| 104 using WebKit::WebKeyboardEvent; | 105 using WebKit::WebKeyboardEvent; |
| 105 using WebKit::WebMouseEvent; | 106 using WebKit::WebMouseEvent; |
| 106 using WebKit::WebMouseWheelEvent; | 107 using WebKit::WebMouseWheelEvent; |
| 107 using WebKit::WebPoint; | 108 using WebKit::WebPoint; |
| 108 using WebKit::WebRect; | 109 using WebKit::WebRect; |
| 109 using WebKit::WebSettings; | 110 using WebKit::WebSettings; |
| 110 using WebKit::WebSettingsImpl; | 111 using WebKit::WebSettingsImpl; |
| 111 using WebKit::WebSize; | 112 using WebKit::WebSize; |
| 112 using WebKit::WebString; | 113 using WebKit::WebString; |
| (...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 808 VKEY_PRIOR : VKEY_NEXT); | 809 VKEY_PRIOR : VKEY_NEXT); |
| 809 return ScrollViewWithKeyboard(key_code); | 810 return ScrollViewWithKeyboard(key_code); |
| 810 } | 811 } |
| 811 break; | 812 break; |
| 812 } | 813 } |
| 813 | 814 |
| 814 case WebInputEvent::RawKeyDown: { | 815 case WebInputEvent::RawKeyDown: { |
| 815 if (event.modifiers == WebInputEvent::ControlKey) { | 816 if (event.modifiers == WebInputEvent::ControlKey) { |
| 816 switch (event.windowsKeyCode) { | 817 switch (event.windowsKeyCode) { |
| 817 case 'A': | 818 case 'A': |
| 818 GetFocusedFrame()->SelectAll(); | 819 GetFocusedFrame()->selectAll(); |
| 819 return true; | 820 return true; |
| 820 case VKEY_INSERT: | 821 case VKEY_INSERT: |
| 821 case 'C': | 822 case 'C': |
| 822 GetFocusedFrame()->Copy(); | 823 GetFocusedFrame()->executeCommand(WebString::fromUTF8("Copy")); |
| 823 return true; | 824 return true; |
| 824 // Match FF behavior in the sense that Ctrl+home/end are the only Ctrl | 825 // Match FF behavior in the sense that Ctrl+home/end are the only Ctrl |
| 825 // key combinations which affect scrolling. Safari is buggy in the | 826 // key combinations which affect scrolling. Safari is buggy in the |
| 826 // sense that it scrolls the page for all Ctrl+scrolling key | 827 // sense that it scrolls the page for all Ctrl+scrolling key |
| 827 // combinations. For e.g. Ctrl+pgup/pgdn/up/down, etc. | 828 // combinations. For e.g. Ctrl+pgup/pgdn/up/down, etc. |
| 828 case VKEY_HOME: | 829 case VKEY_HOME: |
| 829 case VKEY_END: | 830 case VKEY_END: |
| 830 break; | 831 break; |
| 831 default: | 832 default: |
| 832 return false; | 833 return false; |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1287 WebFrame* WebViewImpl::GetNextFrameAfter(WebFrame* frame, bool wrap) { | 1288 WebFrame* WebViewImpl::GetNextFrameAfter(WebFrame* frame, bool wrap) { |
| 1288 WebFrameImpl* frame_impl = static_cast<WebFrameImpl*>(frame); | 1289 WebFrameImpl* frame_impl = static_cast<WebFrameImpl*>(frame); |
| 1289 WebCore::Frame* next = | 1290 WebCore::Frame* next = |
| 1290 frame_impl->frame()->tree()->traverseNextWithWrap(wrap); | 1291 frame_impl->frame()->tree()->traverseNextWithWrap(wrap); |
| 1291 return next ? WebFrameImpl::FromFrame(next) : NULL; | 1292 return next ? WebFrameImpl::FromFrame(next) : NULL; |
| 1292 } | 1293 } |
| 1293 | 1294 |
| 1294 // TODO(darin): these navigation methods should be killed | 1295 // TODO(darin): these navigation methods should be killed |
| 1295 | 1296 |
| 1296 void WebViewImpl::StopLoading() { | 1297 void WebViewImpl::StopLoading() { |
| 1297 main_frame()->StopLoading(); | 1298 main_frame()->stopLoading(); |
| 1298 } | 1299 } |
| 1299 | 1300 |
| 1300 void WebViewImpl::SetBackForwardListSize(int size) { | 1301 void WebViewImpl::SetBackForwardListSize(int size) { |
| 1301 page_->backForwardList()->setCapacity(size); | 1302 page_->backForwardList()->setCapacity(size); |
| 1302 } | 1303 } |
| 1303 | 1304 |
| 1304 void WebViewImpl::ClearFocusedNode() { | 1305 void WebViewImpl::ClearFocusedNode() { |
| 1305 if (!page_.get()) | 1306 if (!page_.get()) |
| 1306 return; | 1307 return; |
| 1307 | 1308 |
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1946 | 1947 |
| 1947 return document->focusedNode(); | 1948 return document->focusedNode(); |
| 1948 } | 1949 } |
| 1949 | 1950 |
| 1950 HitTestResult WebViewImpl::HitTestResultForWindowPos(const IntPoint& pos) { | 1951 HitTestResult WebViewImpl::HitTestResultForWindowPos(const IntPoint& pos) { |
| 1951 IntPoint doc_point( | 1952 IntPoint doc_point( |
| 1952 page_->mainFrame()->view()->windowToContents(pos)); | 1953 page_->mainFrame()->view()->windowToContents(pos)); |
| 1953 return page_->mainFrame()->eventHandler()-> | 1954 return page_->mainFrame()->eventHandler()-> |
| 1954 hitTestResultAtPoint(doc_point, false); | 1955 hitTestResultAtPoint(doc_point, false); |
| 1955 } | 1956 } |
| OLD | NEW |