OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "webkit/api/src/TemporaryGlue.h" | 6 #include "webkit/api/src/TemporaryGlue.h" |
7 | 7 |
| 8 #include "Page.h" |
8 #include <wtf/Assertions.h> | 9 #include <wtf/Assertions.h> |
9 #undef LOG | 10 #undef LOG |
10 | 11 |
| 12 #include "webkit/api/public/WebFrameClient.h" |
11 #include "webkit/glue/chrome_client_impl.h" | 13 #include "webkit/glue/chrome_client_impl.h" |
12 #include "webkit/glue/webview_impl.h" | 14 #include "webkit/glue/webframe_impl.h" |
13 | 15 |
14 using WebCore::Frame; | 16 using WebCore::Frame; |
15 using WebCore::Page; | 17 using WebCore::Page; |
16 | 18 |
17 namespace WebKit { | 19 namespace WebKit { |
18 | 20 |
19 // static | 21 // static |
20 WebMediaPlayer* TemporaryGlue::createWebMediaPlayer( | 22 WebMediaPlayer* TemporaryGlue::createWebMediaPlayer( |
21 WebMediaPlayerClient* client, Frame* frame) { | 23 WebMediaPlayerClient* client, Frame* frame) { |
22 WebViewImpl* webview = WebFrameImpl::FromFrame(frame)->GetWebViewImpl(); | 24 WebFrameImpl* webframe = WebFrameImpl::FromFrame(frame); |
23 if (!webview || !webview->delegate()) | 25 if (!webframe->client()) |
24 return NULL; | 26 return NULL; |
25 | 27 |
26 return webview->delegate()->CreateWebMediaPlayer(client); | 28 return webframe->client()->createMediaPlayer(webframe, client); |
27 } | 29 } |
28 | 30 |
29 // static | 31 // static |
30 void TemporaryGlue::setCursorForPlugin( | 32 void TemporaryGlue::setCursorForPlugin( |
31 const WebCursorInfo& cursor_info, Frame* frame) { | 33 const WebCursorInfo& cursor_info, Frame* frame) { |
32 Page* page = frame->page(); | 34 Page* page = frame->page(); |
33 if (!page) | 35 if (!page) |
34 return; | 36 return; |
35 | 37 |
36 ChromeClientImpl* chrome_client = | 38 ChromeClientImpl* chrome_client = |
37 static_cast<ChromeClientImpl*>(page->chrome()->client()); | 39 static_cast<ChromeClientImpl*>(page->chrome()->client()); |
38 | 40 |
39 // A windowless plugin can change the cursor in response to the WM_MOUSEMOVE | 41 // A windowless plugin can change the cursor in response to the WM_MOUSEMOVE |
40 // event. We need to reflect the changed cursor in the frame view as the | 42 // event. We need to reflect the changed cursor in the frame view as the |
41 // mouse is moved in the boundaries of the windowless plugin. | 43 // mouse is moved in the boundaries of the windowless plugin. |
42 chrome_client->SetCursorForPlugin(cursor_info); | 44 chrome_client->SetCursorForPlugin(cursor_info); |
43 } | 45 } |
44 | 46 |
45 } // namespace WebKit | 47 } // namespace WebKit |
OLD | NEW |