| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/renderer/render_widget_fullscreen_pepper.h" | 5 #include "chrome/renderer/render_widget_fullscreen_pepper.h" |
| 6 | 6 |
| 7 #include "chrome/common/render_messages.h" | 7 #include "chrome/common/render_messages.h" |
| 8 #include "chrome/renderer/render_thread.h" | 8 #include "chrome/renderer/render_thread.h" |
| 9 #include "third_party/WebKit/WebKit/chromium/public/WebCursorInfo.h" | 9 #include "third_party/WebKit/WebKit/chromium/public/WebCursorInfo.h" |
| 10 #include "third_party/WebKit/WebKit/chromium/public/WebSize.h" | 10 #include "third_party/WebKit/WebKit/chromium/public/WebSize.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 DISALLOW_COPY_AND_ASSIGN(WidgetFullscreenContainer); | 155 DISALLOW_COPY_AND_ASSIGN(WidgetFullscreenContainer); |
| 156 }; | 156 }; |
| 157 | 157 |
| 158 } // anonymous namespace | 158 } // anonymous namespace |
| 159 | 159 |
| 160 // static | 160 // static |
| 161 RenderWidgetFullscreenPepper* RenderWidgetFullscreenPepper::Create( | 161 RenderWidgetFullscreenPepper* RenderWidgetFullscreenPepper::Create( |
| 162 int32 opener_id, RenderThreadBase* render_thread, | 162 int32 opener_id, RenderThreadBase* render_thread, |
| 163 pepper::PluginInstance* plugin) { | 163 pepper::PluginInstance* plugin) { |
| 164 DCHECK_NE(MSG_ROUTING_NONE, opener_id); | 164 DCHECK_NE(MSG_ROUTING_NONE, opener_id); |
| 165 scoped_refptr<RenderWidgetFullscreenPepper> widget = | 165 scoped_refptr<RenderWidgetFullscreenPepper> widget( |
| 166 new RenderWidgetFullscreenPepper(render_thread, plugin); | 166 new RenderWidgetFullscreenPepper(render_thread, plugin)); |
| 167 widget->Init(opener_id); | 167 widget->Init(opener_id); |
| 168 return widget.release(); | 168 return widget.release(); |
| 169 } | 169 } |
| 170 | 170 |
| 171 RenderWidgetFullscreenPepper::RenderWidgetFullscreenPepper( | 171 RenderWidgetFullscreenPepper::RenderWidgetFullscreenPepper( |
| 172 RenderThreadBase* render_thread, pepper::PluginInstance* plugin) | 172 RenderThreadBase* render_thread, pepper::PluginInstance* plugin) |
| 173 : RenderWidgetFullscreen(render_thread, WebKit::WebPopupTypeSelect), | 173 : RenderWidgetFullscreen(render_thread, WebKit::WebPopupTypeSelect), |
| 174 plugin_(plugin), | 174 plugin_(plugin), |
| 175 ALLOW_THIS_IN_INITIALIZER_LIST( | 175 ALLOW_THIS_IN_INITIALIZER_LIST( |
| 176 container_(new WidgetFullscreenContainer(this))) { | 176 container_(new WidgetFullscreenContainer(this))) { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 203 void RenderWidgetFullscreenPepper::SendClose() { | 203 void RenderWidgetFullscreenPepper::SendClose() { |
| 204 // This function is called by the plugin instance as it's going away, so reset | 204 // This function is called by the plugin instance as it's going away, so reset |
| 205 // plugin_ to NULL to avoid calling into a dangling pointer e.g. on Close(). | 205 // plugin_ to NULL to avoid calling into a dangling pointer e.g. on Close(). |
| 206 plugin_ = NULL; | 206 plugin_ = NULL; |
| 207 Send(new ViewHostMsg_Close(routing_id_)); | 207 Send(new ViewHostMsg_Close(routing_id_)); |
| 208 } | 208 } |
| 209 | 209 |
| 210 void RenderWidgetFullscreenPepper::GenerateFullRepaint() { | 210 void RenderWidgetFullscreenPepper::GenerateFullRepaint() { |
| 211 didInvalidateRect(gfx::Rect(size_.width(), size_.height())); | 211 didInvalidateRect(gfx::Rect(size_.width(), size_.height())); |
| 212 } | 212 } |
| OLD | NEW |