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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 19744007: Create a public API around webkit::ppapi::PluginInstance and use it in chrome. After this, webkit/p… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 2210 matching lines...) Expand 10 before | Expand all | Expand 10 after
2221 // popup. So from the user perspective, only the first one will show, and 2221 // popup. So from the user perspective, only the first one will show, and
2222 // will have to close the first one before another one can be shown. 2222 // will have to close the first one before another one can be shown.
2223 if (external_popup_menu_) 2223 if (external_popup_menu_)
2224 return NULL; 2224 return NULL;
2225 external_popup_menu_.reset( 2225 external_popup_menu_.reset(
2226 new ExternalPopupMenu(this, popup_menu_info, popup_menu_client)); 2226 new ExternalPopupMenu(this, popup_menu_info, popup_menu_client));
2227 return external_popup_menu_.get(); 2227 return external_popup_menu_.get();
2228 } 2228 }
2229 2229
2230 RenderWidgetFullscreenPepper* RenderViewImpl::CreatePepperFullscreenContainer( 2230 RenderWidgetFullscreenPepper* RenderViewImpl::CreatePepperFullscreenContainer(
2231 webkit::ppapi::PluginInstance* plugin) { 2231 webkit::ppapi::PluginInstanceImpl* plugin) {
2232 #if defined(ENABLE_PLUGINS) 2232 #if defined(ENABLE_PLUGINS)
2233 GURL active_url; 2233 GURL active_url;
2234 if (webview() && webview()->mainFrame()) 2234 if (webview() && webview()->mainFrame())
2235 active_url = GURL(webview()->mainFrame()->document().url()); 2235 active_url = GURL(webview()->mainFrame()->document().url());
2236 RenderWidgetFullscreenPepper* widget = RenderWidgetFullscreenPepper::Create( 2236 RenderWidgetFullscreenPepper* widget = RenderWidgetFullscreenPepper::Create(
2237 routing_id_, plugin, active_url, screen_info_); 2237 routing_id_, plugin, active_url, screen_info_);
2238 widget->show(WebKit::WebNavigationPolicyIgnore); 2238 widget->show(WebKit::WebNavigationPolicyIgnore);
2239 return widget; 2239 return widget;
2240 #else // defined(ENABLE_PLUGINS) 2240 #else // defined(ENABLE_PLUGINS)
2241 NOTREACHED() << "CreatePepperFullscreenContainer: plugins disabled"; 2241 NOTREACHED() << "CreatePepperFullscreenContainer: plugins disabled";
(...skipping 3591 matching lines...) Expand 10 before | Expand all | Expand 10 after
5833 if (document_state->first_paint_time().is_null()) { 5833 if (document_state->first_paint_time().is_null()) {
5834 document_state->set_first_paint_time(now); 5834 document_state->set_first_paint_time(now);
5835 } 5835 }
5836 if (document_state->first_paint_after_load_time().is_null() && 5836 if (document_state->first_paint_after_load_time().is_null() &&
5837 !document_state->finish_load_time().is_null()) { 5837 !document_state->finish_load_time().is_null()) {
5838 document_state->set_first_paint_after_load_time(now); 5838 document_state->set_first_paint_after_load_time(now);
5839 } 5839 }
5840 } 5840 }
5841 } 5841 }
5842 5842
5843 webkit::ppapi::PluginInstance* RenderViewImpl::GetBitmapForOptimizedPluginPaint( 5843 webkit::ppapi::PluginInstanceImpl*
5844 const gfx::Rect& paint_bounds, 5844 RenderViewImpl::GetBitmapForOptimizedPluginPaint(
5845 TransportDIB** dib, 5845 const gfx::Rect& paint_bounds,
5846 gfx::Rect* location, 5846 TransportDIB** dib,
5847 gfx::Rect* clip, 5847 gfx::Rect* location,
5848 float* scale_factor) { 5848 gfx::Rect* clip,
5849 float* scale_factor) {
5849 return pepper_helper_->GetBitmapForOptimizedPluginPaint( 5850 return pepper_helper_->GetBitmapForOptimizedPluginPaint(
5850 paint_bounds, dib, location, clip, scale_factor); 5851 paint_bounds, dib, location, clip, scale_factor);
5851 } 5852 }
5852 5853
5853 gfx::Vector2d RenderViewImpl::GetScrollOffset() { 5854 gfx::Vector2d RenderViewImpl::GetScrollOffset() {
5854 WebSize scroll_offset = webview()->mainFrame()->scrollOffset(); 5855 WebSize scroll_offset = webview()->mainFrame()->scrollOffset();
5855 return gfx::Vector2d(scroll_offset.width, scroll_offset.height); 5856 return gfx::Vector2d(scroll_offset.width, scroll_offset.height);
5856 } 5857 }
5857 5858
5858 void RenderViewImpl::OnClearFocusedNode() { 5859 void RenderViewImpl::OnClearFocusedNode() {
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after
6771 WebURL url = icon_urls[i].iconURL(); 6772 WebURL url = icon_urls[i].iconURL();
6772 if (!url.isEmpty()) 6773 if (!url.isEmpty())
6773 urls.push_back(FaviconURL(url, 6774 urls.push_back(FaviconURL(url,
6774 ToFaviconType(icon_urls[i].iconType()))); 6775 ToFaviconType(icon_urls[i].iconType())));
6775 } 6776 }
6776 SendUpdateFaviconURL(urls); 6777 SendUpdateFaviconURL(urls);
6777 } 6778 }
6778 6779
6779 6780
6780 } // namespace content 6781 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698