| Index: webkit/glue/webview_impl.cc
|
| ===================================================================
|
| --- webkit/glue/webview_impl.cc (revision 22997)
|
| +++ webkit/glue/webview_impl.cc (working copy)
|
| @@ -810,7 +810,7 @@
|
| if (event.windowsKeyCode == VKEY_SPACE) {
|
| int key_code = ((event.modifiers & WebInputEvent::ShiftKey) ?
|
| VKEY_PRIOR : VKEY_NEXT);
|
| - return ScrollViewWithKeyboard(key_code);
|
| + return ScrollViewWithKeyboard(key_code, event.modifiers);
|
| }
|
| break;
|
| }
|
| @@ -837,7 +837,7 @@
|
| }
|
| }
|
| if (!event.isSystemKey) {
|
| - return ScrollViewWithKeyboard(event.windowsKeyCode);
|
| + return ScrollViewWithKeyboard(event.windowsKeyCode, event.modifiers);
|
| }
|
| break;
|
| }
|
| @@ -848,7 +848,7 @@
|
| return false;
|
| }
|
|
|
| -bool WebViewImpl::ScrollViewWithKeyboard(int key_code) {
|
| +bool WebViewImpl::ScrollViewWithKeyboard(int key_code, int modifiers) {
|
| Frame* frame = GetFocusedWebCoreFrame();
|
| if (!frame)
|
| return false;
|
| @@ -867,11 +867,29 @@
|
| 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;
|
|
|