OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "core/page/Page.h" | 44 #include "core/page/Page.h" |
45 #include "core/page/PagePopupClient.h" | 45 #include "core/page/PagePopupClient.h" |
46 #include "platform/TraceEvent.h" | 46 #include "platform/TraceEvent.h" |
47 #include "public/platform/WebCursorInfo.h" | 47 #include "public/platform/WebCursorInfo.h" |
48 #include "public/web/WebViewClient.h" | 48 #include "public/web/WebViewClient.h" |
49 #include "public/web/WebWidgetClient.h" | 49 #include "public/web/WebWidgetClient.h" |
50 #include "web/WebInputEventConversion.h" | 50 #include "web/WebInputEventConversion.h" |
51 #include "web/WebSettingsImpl.h" | 51 #include "web/WebSettingsImpl.h" |
52 #include "web/WebViewImpl.h" | 52 #include "web/WebViewImpl.h" |
53 | 53 |
54 using namespace blink; | |
55 | |
56 namespace blink { | 54 namespace blink { |
57 | 55 |
58 class PagePopupChromeClient : public EmptyChromeClient { | 56 class PagePopupChromeClient : public EmptyChromeClient { |
59 WTF_MAKE_NONCOPYABLE(PagePopupChromeClient); | 57 WTF_MAKE_NONCOPYABLE(PagePopupChromeClient); |
60 WTF_MAKE_FAST_ALLOCATED; | 58 WTF_MAKE_FAST_ALLOCATED; |
61 | 59 |
62 public: | 60 public: |
63 explicit PagePopupChromeClient(WebPagePopupImpl* popup) | 61 explicit PagePopupChromeClient(WebPagePopupImpl* popup) |
64 : m_popup(popup) | 62 : m_popup(popup) |
65 { | 63 { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 virtual void* webView() const OVERRIDE | 118 virtual void* webView() const OVERRIDE |
121 { | 119 { |
122 return m_popup->m_webView; | 120 return m_popup->m_webView; |
123 } | 121 } |
124 | 122 |
125 virtual FloatSize minimumWindowSize() const OVERRIDE | 123 virtual FloatSize minimumWindowSize() const OVERRIDE |
126 { | 124 { |
127 return FloatSize(0, 0); | 125 return FloatSize(0, 0); |
128 } | 126 } |
129 | 127 |
130 virtual void setCursor(const blink::Cursor& cursor) OVERRIDE | 128 virtual void setCursor(const Cursor& cursor) OVERRIDE |
131 { | 129 { |
132 if (m_popup->m_webView->client()) | 130 if (m_popup->m_webView->client()) |
133 m_popup->m_webView->client()->didChangeCursor(WebCursorInfo(cursor))
; | 131 m_popup->m_webView->client()->didChangeCursor(WebCursorInfo(cursor))
; |
134 } | 132 } |
135 | 133 |
136 virtual void needTouchEvents(bool needsTouchEvents) OVERRIDE | 134 virtual void needTouchEvents(bool needsTouchEvents) OVERRIDE |
137 { | 135 { |
138 m_popup->widgetClient()->hasTouchEventHandlers(needsTouchEvents); | 136 m_popup->widgetClient()->hasTouchEventHandlers(needsTouchEvents); |
139 } | 137 } |
140 | 138 |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 // A WebPagePopupImpl instance usually has two references. | 394 // A WebPagePopupImpl instance usually has two references. |
397 // - One owned by the instance itself. It represents the visible widget. | 395 // - One owned by the instance itself. It represents the visible widget. |
398 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the | 396 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the |
399 // WebPagePopupImpl to close. | 397 // WebPagePopupImpl to close. |
400 // We need them because the closing operation is asynchronous and the widget | 398 // We need them because the closing operation is asynchronous and the widget |
401 // can be closed while the WebViewImpl is unaware of it. | 399 // can be closed while the WebViewImpl is unaware of it. |
402 return adoptRef(new WebPagePopupImpl(client)).leakRef(); | 400 return adoptRef(new WebPagePopupImpl(client)).leakRef(); |
403 } | 401 } |
404 | 402 |
405 } // namespace blink | 403 } // namespace blink |
OLD | NEW |