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

Side by Side Diff: Source/web/WebFrameWidgetImpl.cpp

Issue 1147283002: Add ScrollDirectionPhysical enum in Scroll types. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed a conflict on EventHandler Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « Source/platform/scroll/Scrollbar.cpp ('k') | Source/web/WebPluginContainerImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 return false; 879 return false;
880 } 880 }
881 881
882 bool WebFrameWidgetImpl::mapKeyCodeForScroll( 882 bool WebFrameWidgetImpl::mapKeyCodeForScroll(
883 int keyCode, 883 int keyCode,
884 ScrollDirection* scrollDirection, 884 ScrollDirection* scrollDirection,
885 ScrollGranularity* scrollGranularity) 885 ScrollGranularity* scrollGranularity)
886 { 886 {
887 switch (keyCode) { 887 switch (keyCode) {
888 case VKEY_LEFT: 888 case VKEY_LEFT:
889 *scrollDirection = ScrollLeft; 889 *scrollDirection = ScrollLeftIgnoringWritingMode;
890 *scrollGranularity = ScrollByLine; 890 *scrollGranularity = ScrollByLine;
891 break; 891 break;
892 case VKEY_RIGHT: 892 case VKEY_RIGHT:
893 *scrollDirection = ScrollRight; 893 *scrollDirection = ScrollRightIgnoringWritingMode;
894 *scrollGranularity = ScrollByLine; 894 *scrollGranularity = ScrollByLine;
895 break; 895 break;
896 case VKEY_UP: 896 case VKEY_UP:
897 *scrollDirection = ScrollUp; 897 *scrollDirection = ScrollUpIgnoringWritingMode;
898 *scrollGranularity = ScrollByLine; 898 *scrollGranularity = ScrollByLine;
899 break; 899 break;
900 case VKEY_DOWN: 900 case VKEY_DOWN:
901 *scrollDirection = ScrollDown; 901 *scrollDirection = ScrollDownIgnoringWritingMode;
902 *scrollGranularity = ScrollByLine; 902 *scrollGranularity = ScrollByLine;
903 break; 903 break;
904 case VKEY_HOME: 904 case VKEY_HOME:
905 *scrollDirection = ScrollUp; 905 *scrollDirection = ScrollUpIgnoringWritingMode;
906 *scrollGranularity = ScrollByDocument; 906 *scrollGranularity = ScrollByDocument;
907 break; 907 break;
908 case VKEY_END: 908 case VKEY_END:
909 *scrollDirection = ScrollDown; 909 *scrollDirection = ScrollDownIgnoringWritingMode;
910 *scrollGranularity = ScrollByDocument; 910 *scrollGranularity = ScrollByDocument;
911 break; 911 break;
912 case VKEY_PRIOR: // page up 912 case VKEY_PRIOR: // page up
913 *scrollDirection = ScrollUp; 913 *scrollDirection = ScrollUpIgnoringWritingMode;
914 *scrollGranularity = ScrollByPage; 914 *scrollGranularity = ScrollByPage;
915 break; 915 break;
916 case VKEY_NEXT: // page down 916 case VKEY_NEXT: // page down
917 *scrollDirection = ScrollDown; 917 *scrollDirection = ScrollDownIgnoringWritingMode;
918 *scrollGranularity = ScrollByPage; 918 *scrollGranularity = ScrollByPage;
919 break; 919 break;
920 default: 920 default:
921 return false; 921 return false;
922 } 922 }
923 923
924 return true; 924 return true;
925 } 925 }
926 926
927 Frame* WebFrameWidgetImpl::focusedCoreFrame() const 927 Frame* WebFrameWidgetImpl::focusedCoreFrame() const
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 // correspond to Page visibility, but is necessary until we properly sort ou t OOPIF visibility. 1055 // correspond to Page visibility, but is necessary until we properly sort ou t OOPIF visibility.
1056 m_page->setVisibilityState(static_cast<PageVisibilityState>(visibilityState) , isInitialState); 1056 m_page->setVisibilityState(static_cast<PageVisibilityState>(visibilityState) , isInitialState);
1057 1057
1058 if (m_layerTreeView) { 1058 if (m_layerTreeView) {
1059 bool visible = visibilityState == WebPageVisibilityStateVisible; 1059 bool visible = visibilityState == WebPageVisibilityStateVisible;
1060 m_layerTreeView->setVisible(visible); 1060 m_layerTreeView->setVisible(visible);
1061 } 1061 }
1062 } 1062 }
1063 1063
1064 } // namespace blink 1064 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/scroll/Scrollbar.cpp ('k') | Source/web/WebPluginContainerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698