Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Unified Diff: webkit/glue/webview_impl.cc

Issue 254002: Fix cmd-up/cmd-down. (Closed)
Patch Set: Fix typo found by suzhe Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« webkit/glue/webframe_impl.cc ('K') | « webkit/glue/webview_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webview_impl.cc
diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc
index 6900853df2e007985a1937002522cf2b902cf6fc..74a4c3ffe05c565bcb12af411f4173f89abd4905 100644
--- a/webkit/glue/webview_impl.cc
+++ b/webkit/glue/webview_impl.cc
@@ -862,10 +862,6 @@ bool WebViewImpl::KeyEventDefault(const WebKeyboardEvent& event) {
}
bool WebViewImpl::ScrollViewWithKeyboard(int key_code, int modifiers) {
- Frame* frame = GetFocusedWebCoreFrame();
- if (!frame)
- return false;
-
ScrollDirection scroll_direction;
ScrollGranularity scroll_granularity;
@@ -880,29 +876,11 @@ bool WebViewImpl::ScrollViewWithKeyboard(int key_code, int modifiers) {
break;
case VKEY_UP:
scroll_direction = ScrollUp;
-#if defined(OS_MACOSX)
- // Many Mac applications (such as TextEdit, Safari, Firefox, etc.) scroll
- // to the beginning of a page when typing command+up keys. It is better
- // for Mac Chrome to emulate this behavior to improve compatibility with
- // these applications.
- scroll_granularity = (modifiers == WebInputEvent::MetaKey) ?
- ScrollByDocument : ScrollByLine;
-#else
scroll_granularity = ScrollByLine;
-#endif
break;
case VKEY_DOWN:
scroll_direction = ScrollDown;
-#if defined(OS_MACOSX)
- // Many Mac applications (such as TextEdit, Safari, Firefox, etc.) scroll
- // to the end of a page when typing command+down keys. It is better
- // for Mac Chrome to emulate this behavior to improve compatibility with
- // these applications.
- scroll_granularity = (modifiers == WebInputEvent::MetaKey) ?
- ScrollByDocument : ScrollByLine;
-#else
scroll_granularity = ScrollByLine;
-#endif
break;
case VKEY_HOME:
scroll_direction = ScrollUp;
@@ -924,6 +902,17 @@ bool WebViewImpl::ScrollViewWithKeyboard(int key_code, int modifiers) {
return false;
}
+ return PropagateScroll(scroll_direction, scroll_granularity);
+}
+
+bool WebViewImpl::PropagateScroll(
+ WebCore::ScrollDirection scroll_direction,
+ WebCore::ScrollGranularity scroll_granularity) {
+
+ Frame* frame = GetFocusedWebCoreFrame();
+ if (!frame)
+ return false;
+
bool scroll_handled =
frame->eventHandler()->scrollOverflow(scroll_direction,
scroll_granularity);
« webkit/glue/webframe_impl.cc ('K') | « webkit/glue/webview_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698