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

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

Issue 1310533007: Devtools[LayoutEditor]: show resizer cursor over anchors (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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/ChromeClientImpl.h ('k') | Source/web/InspectorOverlayImpl.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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 // Converts a AXObjectCache::AXNotification to a WebAXEvent 112 // Converts a AXObjectCache::AXNotification to a WebAXEvent
113 static WebAXEvent toWebAXEvent(AXObjectCache::AXNotification notification) 113 static WebAXEvent toWebAXEvent(AXObjectCache::AXNotification notification)
114 { 114 {
115 // These enums have the same values; enforced in AssertMatchingEnums.cpp. 115 // These enums have the same values; enforced in AssertMatchingEnums.cpp.
116 return static_cast<WebAXEvent>(notification); 116 return static_cast<WebAXEvent>(notification);
117 } 117 }
118 118
119 ChromeClientImpl::ChromeClientImpl(WebViewImpl* webView) 119 ChromeClientImpl::ChromeClientImpl(WebViewImpl* webView)
120 : m_webView(webView) 120 : m_webView(webView)
121 , m_overrideCursor(pointerCursor())
121 { 122 {
122 } 123 }
123 124
124 ChromeClientImpl::~ChromeClientImpl() 125 ChromeClientImpl::~ChromeClientImpl()
125 { 126 {
126 } 127 }
127 128
128 PassOwnPtrWillBeRawPtr<ChromeClientImpl> ChromeClientImpl::create(WebViewImpl* w ebView) 129 PassOwnPtrWillBeRawPtr<ChromeClientImpl> ChromeClientImpl::create(WebViewImpl* w ebView)
129 { 130 {
130 return adoptPtrWillBeNoop(new ChromeClientImpl(webView)); 131 return adoptPtrWillBeNoop(new ChromeClientImpl(webView));
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 } 654 }
654 655
655 Cursor ChromeClientImpl::lastSetCursorForTesting() const 656 Cursor ChromeClientImpl::lastSetCursorForTesting() const
656 { 657 {
657 return m_lastSetMouseCursorForTesting; 658 return m_lastSetMouseCursorForTesting;
658 } 659 }
659 660
660 void ChromeClientImpl::setCursor(const Cursor& cursor) 661 void ChromeClientImpl::setCursor(const Cursor& cursor)
661 { 662 {
662 m_lastSetMouseCursorForTesting = cursor; 663 m_lastSetMouseCursorForTesting = cursor;
663 setCursor(WebCursorInfo(cursor)); 664 if (m_overrideCursor.type() == Cursor::Pointer)
pfeldman 2015/08/24 18:22:40 Why is this check here?
sergeyv 2015/08/26 01:57:41 Done.
665 setCursor(WebCursorInfo(cursor));
664 } 666 }
665 667
666 void ChromeClientImpl::setCursor(const WebCursorInfo& cursor) 668 void ChromeClientImpl::setCursor(const WebCursorInfo& cursor)
667 { 669 {
668 #if OS(MACOSX) 670 #if OS(MACOSX)
669 // On Mac the mousemove event propagates to both the popup and main window. 671 // On Mac the mousemove event propagates to both the popup and main window.
670 // If a popup is open we don't want the main window to change the cursor. 672 // If a popup is open we don't want the main window to change the cursor.
671 if (m_webView->hasOpenedPopup()) 673 if (m_webView->hasOpenedPopup())
672 return; 674 return;
673 #endif 675 #endif
674 if (m_webView->client()) 676 if (m_webView->client())
675 m_webView->client()->didChangeCursor(cursor); 677 m_webView->client()->didChangeCursor(cursor);
676 } 678 }
677 679
678 void ChromeClientImpl::setCursorForPlugin(const WebCursorInfo& cursor) 680 void ChromeClientImpl::setCursorForPlugin(const WebCursorInfo& cursor)
679 { 681 {
680 setCursor(cursor); 682 setCursor(cursor);
681 } 683 }
682 684
685 void ChromeClientImpl::setCursorOverride(const Cursor& cursor)
686 {
687 if (m_overrideCursor.type() == cursor.type())
688 return;
689
690 m_overrideCursor = cursor;
691 setCursor(WebCursorInfo(cursor));
692 }
693
683 void ChromeClientImpl::postAccessibilityNotification(AXObject* obj, AXObjectCach e::AXNotification notification) 694 void ChromeClientImpl::postAccessibilityNotification(AXObject* obj, AXObjectCach e::AXNotification notification)
684 { 695 {
685 // Alert assistive technology about the accessibility object notification. 696 // Alert assistive technology about the accessibility object notification.
686 if (!obj || !obj->document()) 697 if (!obj || !obj->document())
687 return; 698 return;
688 699
689 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(obj->document()-> axObjectCacheOwner().frame()); 700 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(obj->document()-> axObjectCacheOwner().frame());
690 if (webframe && webframe->client()) 701 if (webframe && webframe->client())
691 webframe->client()->postAccessibilityEvent(WebAXObject(obj), toWebAXEven t(notification)); 702 webframe->client()->postAccessibilityEvent(WebAXObject(obj), toWebAXEven t(notification));
692 } 703 }
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 for (const auto& observer : observers) 987 for (const auto& observer : observers)
977 observer->willOpenPopup(); 988 observer->willOpenPopup();
978 } 989 }
979 990
980 FloatSize ChromeClientImpl::elasticOverscroll() const 991 FloatSize ChromeClientImpl::elasticOverscroll() const
981 { 992 {
982 return m_webView->elasticOverscroll(); 993 return m_webView->elasticOverscroll();
983 } 994 }
984 995
985 } // namespace blink 996 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/ChromeClientImpl.h ('k') | Source/web/InspectorOverlayImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698