Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1867 // will have to close the first one before another one can be shown. | 1867 // will have to close the first one before another one can be shown. |
| 1868 if (external_popup_menu_.get()) | 1868 if (external_popup_menu_.get()) |
| 1869 return NULL; | 1869 return NULL; |
| 1870 external_popup_menu_.reset( | 1870 external_popup_menu_.reset( |
| 1871 new ExternalPopupMenu(this, popup_menu_info, popup_menu_client)); | 1871 new ExternalPopupMenu(this, popup_menu_info, popup_menu_client)); |
| 1872 return external_popup_menu_.get(); | 1872 return external_popup_menu_.get(); |
| 1873 } | 1873 } |
| 1874 | 1874 |
| 1875 RenderWidgetFullscreenPepper* RenderViewImpl::CreatePepperFullscreenContainer( | 1875 RenderWidgetFullscreenPepper* RenderViewImpl::CreatePepperFullscreenContainer( |
| 1876 webkit::ppapi::PluginInstance* plugin) { | 1876 webkit::ppapi::PluginInstance* plugin) { |
| 1877 #if defined(ENABLE_PLUGINS) | |
| 1877 GURL active_url; | 1878 GURL active_url; |
| 1878 if (webview() && webview()->mainFrame()) | 1879 if (webview() && webview()->mainFrame()) |
| 1879 active_url = GURL(webview()->mainFrame()->document().url()); | 1880 active_url = GURL(webview()->mainFrame()->document().url()); |
| 1880 RenderWidgetFullscreenPepper* widget = RenderWidgetFullscreenPepper::Create( | 1881 RenderWidgetFullscreenPepper* widget = RenderWidgetFullscreenPepper::Create( |
| 1881 routing_id_, plugin, active_url, screen_info_); | 1882 routing_id_, plugin, active_url, screen_info_); |
| 1882 widget->show(WebKit::WebNavigationPolicyIgnore); | 1883 widget->show(WebKit::WebNavigationPolicyIgnore); |
| 1883 return widget; | 1884 return widget; |
| 1885 #else // defined(ENABLE_PLUGINS) | |
| 1886 return NULL; | |
|
stuartmorgan
2012/12/19 12:53:58
Shouldn't these functions both have a NOTREACHED()
nilesh
2012/12/19 21:07:44
Added NOTREACHED here.
RenderViewImpl::createPlug
| |
| 1887 #endif | |
| 1884 } | 1888 } |
| 1885 | 1889 |
| 1886 WebStorageNamespace* RenderViewImpl::createSessionStorageNamespace( | 1890 WebStorageNamespace* RenderViewImpl::createSessionStorageNamespace( |
| 1887 unsigned quota) { | 1891 unsigned quota) { |
| 1888 CHECK(session_storage_namespace_id_ != | 1892 CHECK(session_storage_namespace_id_ != |
| 1889 dom_storage::kInvalidSessionStorageNamespaceId); | 1893 dom_storage::kInvalidSessionStorageNamespaceId); |
| 1890 return new WebStorageNamespaceImpl(session_storage_namespace_id_); | 1894 return new WebStorageNamespaceImpl(session_storage_namespace_id_); |
| 1891 } | 1895 } |
| 1892 | 1896 |
| 1893 WebKit::WebCompositorOutputSurface* RenderViewImpl::createOutputSurface() { | 1897 WebKit::WebCompositorOutputSurface* RenderViewImpl::createOutputSurface() { |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2499 | 2503 |
| 2500 RenderWidget::didActivateCompositor(input_handler_identifier); | 2504 RenderWidget::didActivateCompositor(input_handler_identifier); |
| 2501 | 2505 |
| 2502 ProcessAcceleratedPinchZoomFlags(*CommandLine::ForCurrentProcess()); | 2506 ProcessAcceleratedPinchZoomFlags(*CommandLine::ForCurrentProcess()); |
| 2503 } | 2507 } |
| 2504 | 2508 |
| 2505 // WebKit::WebFrameClient ----------------------------------------------------- | 2509 // WebKit::WebFrameClient ----------------------------------------------------- |
| 2506 | 2510 |
| 2507 WebPlugin* RenderViewImpl::createPlugin(WebFrame* frame, | 2511 WebPlugin* RenderViewImpl::createPlugin(WebFrame* frame, |
| 2508 const WebPluginParams& params) { | 2512 const WebPluginParams& params) { |
| 2513 #if !defined(ENABLE_PLUGINS) | |
|
jam
2012/12/19 01:55:15
nit: can you flip the order here so that it's easi
nilesh
2012/12/19 21:07:44
Done.
| |
| 2514 return NULL; | |
| 2515 #else | |
| 2509 WebPlugin* plugin = NULL; | 2516 WebPlugin* plugin = NULL; |
| 2510 if (GetContentClient()->renderer()->OverrideCreatePlugin( | 2517 if (GetContentClient()->renderer()->OverrideCreatePlugin( |
| 2511 this, frame, params, &plugin)) { | 2518 this, frame, params, &plugin)) { |
| 2512 return plugin; | 2519 return plugin; |
| 2513 } | 2520 } |
| 2514 | 2521 |
| 2515 if (UTF16ToASCII(params.mimeType) == kBrowserPluginMimeType) { | 2522 if (UTF16ToASCII(params.mimeType) == kBrowserPluginMimeType) { |
| 2516 return browser_plugin_manager()->CreateBrowserPlugin(this, frame, params); | 2523 return browser_plugin_manager()->CreateBrowserPlugin(this, frame, params); |
| 2517 } | 2524 } |
| 2518 | 2525 |
| 2519 webkit::WebPluginInfo info; | 2526 webkit::WebPluginInfo info; |
| 2520 std::string mime_type; | 2527 std::string mime_type; |
| 2521 bool found = GetPluginInfo(params.url, frame->top()->document().url(), | 2528 bool found = GetPluginInfo(params.url, frame->top()->document().url(), |
| 2522 params.mimeType.utf8(), &info, &mime_type); | 2529 params.mimeType.utf8(), &info, &mime_type); |
| 2523 if (!found) | 2530 if (!found) |
| 2524 return NULL; | 2531 return NULL; |
| 2525 | 2532 |
| 2526 WebPluginParams params_to_use = params; | 2533 WebPluginParams params_to_use = params; |
| 2527 params_to_use.mimeType = WebString::fromUTF8(mime_type); | 2534 params_to_use.mimeType = WebString::fromUTF8(mime_type); |
| 2528 return CreatePlugin(frame, info, params_to_use); | 2535 return CreatePlugin(frame, info, params_to_use); |
| 2536 #endif | |
| 2529 } | 2537 } |
| 2530 | 2538 |
| 2531 WebSharedWorker* RenderViewImpl::createSharedWorker( | 2539 WebSharedWorker* RenderViewImpl::createSharedWorker( |
| 2532 WebFrame* frame, const WebURL& url, const WebString& name, | 2540 WebFrame* frame, const WebURL& url, const WebString& name, |
| 2533 unsigned long long document_id) { | 2541 unsigned long long document_id) { |
| 2534 | 2542 |
| 2535 int route_id = MSG_ROUTING_NONE; | 2543 int route_id = MSG_ROUTING_NONE; |
| 2536 bool exists = false; | 2544 bool exists = false; |
| 2537 bool url_mismatch = false; | 2545 bool url_mismatch = false; |
| 2538 ViewHostMsg_CreateWorker_Params params; | 2546 ViewHostMsg_CreateWorker_Params params; |
| (...skipping 3964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6503 } | 6511 } |
| 6504 #endif | 6512 #endif |
| 6505 | 6513 |
| 6506 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( | 6514 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( |
| 6507 TransportDIB::Handle dib_handle) { | 6515 TransportDIB::Handle dib_handle) { |
| 6508 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 6516 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |
| 6509 RenderProcess::current()->ReleaseTransportDIB(dib); | 6517 RenderProcess::current()->ReleaseTransportDIB(dib); |
| 6510 } | 6518 } |
| 6511 | 6519 |
| 6512 } // namespace content | 6520 } // namespace content |
| OLD | NEW |