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

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: Rebase Created 5 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/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_cursorOverridden(false)
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 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 } 657 }
657 658
658 void ChromeClientImpl::setCursor(const Cursor& cursor) 659 void ChromeClientImpl::setCursor(const Cursor& cursor)
659 { 660 {
660 m_lastSetMouseCursorForTesting = cursor; 661 m_lastSetMouseCursorForTesting = cursor;
661 setCursor(WebCursorInfo(cursor)); 662 setCursor(WebCursorInfo(cursor));
662 } 663 }
663 664
664 void ChromeClientImpl::setCursor(const WebCursorInfo& cursor) 665 void ChromeClientImpl::setCursor(const WebCursorInfo& cursor)
665 { 666 {
667 if (m_cursorOverridden)
668 return;
669
666 #if OS(MACOSX) 670 #if OS(MACOSX)
667 // 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.
668 // 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.
669 if (m_webView->hasOpenedPopup()) 673 if (m_webView->hasOpenedPopup())
670 return; 674 return;
671 #endif 675 #endif
672 if (m_webView->client()) 676 if (m_webView->client())
673 m_webView->client()->didChangeCursor(cursor); 677 m_webView->client()->didChangeCursor(cursor);
674 } 678 }
675 679
676 void ChromeClientImpl::setCursorForPlugin(const WebCursorInfo& cursor) 680 void ChromeClientImpl::setCursorForPlugin(const WebCursorInfo& cursor)
677 { 681 {
678 setCursor(cursor); 682 setCursor(cursor);
679 } 683 }
680 684
685 void ChromeClientImpl::setCursorOverridden(bool overridden)
686 {
687 m_cursorOverridden = overridden;
688 }
689
681 void ChromeClientImpl::postAccessibilityNotification(AXObject* obj, AXObjectCach e::AXNotification notification) 690 void ChromeClientImpl::postAccessibilityNotification(AXObject* obj, AXObjectCach e::AXNotification notification)
682 { 691 {
683 // Alert assistive technology about the accessibility object notification. 692 // Alert assistive technology about the accessibility object notification.
684 if (!obj || !obj->document()) 693 if (!obj || !obj->document())
685 return; 694 return;
686 695
687 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(obj->document()-> axObjectCacheOwner().frame()); 696 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(obj->document()-> axObjectCacheOwner().frame());
688 if (webframe && webframe->client()) 697 if (webframe && webframe->client())
689 webframe->client()->postAccessibilityEvent(WebAXObject(obj), toWebAXEven t(notification)); 698 webframe->client()->postAccessibilityEvent(WebAXObject(obj), toWebAXEven t(notification));
690 } 699 }
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 for (const auto& observer : observers) 995 for (const auto& observer : observers)
987 observer->willOpenPopup(); 996 observer->willOpenPopup();
988 } 997 }
989 998
990 FloatSize ChromeClientImpl::elasticOverscroll() const 999 FloatSize ChromeClientImpl::elasticOverscroll() const
991 { 1000 {
992 return m_webView->elasticOverscroll(); 1001 return m_webView->elasticOverscroll();
993 } 1002 }
994 1003
995 } // namespace blink 1004 } // 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