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

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

Issue 23654015: Avoid using !OS() constructs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix merge Created 7 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 unified diff | Download patch
« no previous file with comments | « Source/web/WebFrameImpl.cpp ('k') | no next file » | 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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 hideSelectPopup(); 545 hideSelectPopup();
546 } 546 }
547 547
548 if (m_pagePopup && pagePopup && m_pagePopup->hasSamePopupClient(pagePopup.ge t())) { 548 if (m_pagePopup && pagePopup && m_pagePopup->hasSamePopupClient(pagePopup.ge t())) {
549 // That click triggered a page popup that is the same as the one we just closed. 549 // That click triggered a page popup that is the same as the one we just closed.
550 // It needs to be closed. 550 // It needs to be closed.
551 closePagePopup(m_pagePopup.get()); 551 closePagePopup(m_pagePopup.get());
552 } 552 }
553 553
554 // Dispatch the contextmenu event regardless of if the click was swallowed. 554 // Dispatch the contextmenu event regardless of if the click was swallowed.
555 #if OS(WIN)
555 // On Windows, we handle it on mouse up, not down. 556 // On Windows, we handle it on mouse up, not down.
556 #if OS(MACOSX) 557 #elif OS(MACOSX)
557 if (event.button == WebMouseEvent::ButtonRight 558 if (event.button == WebMouseEvent::ButtonRight
558 || (event.button == WebMouseEvent::ButtonLeft 559 || (event.button == WebMouseEvent::ButtonLeft
559 && event.modifiers & WebMouseEvent::ControlKey)) 560 && event.modifiers & WebMouseEvent::ControlKey))
560 mouseContextMenu(event); 561 mouseContextMenu(event);
561 #elif OS(POSIX) 562 #else
562 if (event.button == WebMouseEvent::ButtonRight) 563 if (event.button == WebMouseEvent::ButtonRight)
563 mouseContextMenu(event); 564 mouseContextMenu(event);
564 #endif 565 #endif
565 } 566 }
566 567
567 void WebViewImpl::mouseContextMenu(const WebMouseEvent& event) 568 void WebViewImpl::mouseContextMenu(const WebMouseEvent& event)
568 { 569 {
569 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 570 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
570 return; 571 return;
571 572
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 return false; 931 return false;
931 932
932 EventHandler* handler = frame->eventHandler(); 933 EventHandler* handler = frame->eventHandler();
933 if (!handler) 934 if (!handler)
934 return keyEventDefault(event); 935 return keyEventDefault(event);
935 936
936 #if !OS(MACOSX) 937 #if !OS(MACOSX)
937 const WebInputEvent::Type contextMenuTriggeringEventType = 938 const WebInputEvent::Type contextMenuTriggeringEventType =
938 #if OS(WIN) 939 #if OS(WIN)
939 WebInputEvent::KeyUp; 940 WebInputEvent::KeyUp;
940 #elif OS(POSIX) 941 #else
941 WebInputEvent::RawKeyDown; 942 WebInputEvent::RawKeyDown;
942 #endif 943 #endif
943 944
944 bool isUnmodifiedMenuKey = !(event.modifiers & WebInputEvent::InputModifiers ) && event.windowsKeyCode == VKEY_APPS; 945 bool isUnmodifiedMenuKey = !(event.modifiers & WebInputEvent::InputModifiers ) && event.windowsKeyCode == VKEY_APPS;
945 bool isShiftF10 = event.modifiers == WebInputEvent::ShiftKey && event.window sKeyCode == VKEY_F10; 946 bool isShiftF10 = event.modifiers == WebInputEvent::ShiftKey && event.window sKeyCode == VKEY_F10;
946 if ((isUnmodifiedMenuKey || isShiftF10) && event.type == contextMenuTriggeri ngEventType) { 947 if ((isUnmodifiedMenuKey || isShiftF10) && event.type == contextMenuTriggeri ngEventType) {
947 sendContextMenuEvent(event); 948 sendContextMenuEvent(event);
948 return true; 949 return true;
949 } 950 }
950 #endif // !OS(MACOSX) 951 #endif // !OS(MACOSX)
(...skipping 3163 matching lines...) Expand 10 before | Expand all | Expand 10 after
4114 // the initial viewport width. 4115 // the initial viewport width.
4115 // 2. The author has disabled viewport zoom. 4116 // 2. The author has disabled viewport zoom.
4116 4117
4117 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4118 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4118 4119
4119 return fixedLayoutSize().width == m_size.width 4120 return fixedLayoutSize().width == m_size.width
4120 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4121 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4121 } 4122 }
4122 4123
4123 } // namespace WebKit 4124 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/web/WebFrameImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698