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

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

Issue 687273004: Measure the number of frame loads with Flash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments, add more actions Created 6 years, 1 month 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #include "content/public/common/page_state.h" 45 #include "content/public/common/page_state.h"
46 #include "content/public/common/resource_response.h" 46 #include "content/public/common/resource_response.h"
47 #include "content/public/common/url_constants.h" 47 #include "content/public/common/url_constants.h"
48 #include "content/public/common/url_utils.h" 48 #include "content/public/common/url_utils.h"
49 #include "content/public/renderer/browser_plugin_delegate.h" 49 #include "content/public/renderer/browser_plugin_delegate.h"
50 #include "content/public/renderer/content_renderer_client.h" 50 #include "content/public/renderer/content_renderer_client.h"
51 #include "content/public/renderer/context_menu_client.h" 51 #include "content/public/renderer/context_menu_client.h"
52 #include "content/public/renderer/document_state.h" 52 #include "content/public/renderer/document_state.h"
53 #include "content/public/renderer/navigation_state.h" 53 #include "content/public/renderer/navigation_state.h"
54 #include "content/public/renderer/render_frame_observer.h" 54 #include "content/public/renderer/render_frame_observer.h"
55 #include "content/public/renderer/renderer_ppapi_host.h"
55 #include "content/renderer/accessibility/renderer_accessibility_complete.h" 56 #include "content/renderer/accessibility/renderer_accessibility_complete.h"
56 #include "content/renderer/browser_plugin/browser_plugin.h" 57 #include "content/renderer/browser_plugin/browser_plugin.h"
57 #include "content/renderer/browser_plugin/browser_plugin_manager.h" 58 #include "content/renderer/browser_plugin/browser_plugin_manager.h"
58 #include "content/renderer/child_frame_compositing_helper.h" 59 #include "content/renderer/child_frame_compositing_helper.h"
59 #include "content/renderer/context_menu_params_builder.h" 60 #include "content/renderer/context_menu_params_builder.h"
60 #include "content/renderer/devtools/devtools_agent.h" 61 #include "content/renderer/devtools/devtools_agent.h"
61 #include "content/renderer/dom_automation_controller.h" 62 #include "content/renderer/dom_automation_controller.h"
62 #include "content/renderer/dom_utils.h" 63 #include "content/renderer/dom_utils.h"
63 #include "content/renderer/external_popup_menu.h" 64 #include "content/renderer/external_popup_menu.h"
64 #include "content/renderer/geolocation_dispatcher.h" 65 #include "content/renderer/geolocation_dispatcher.h"
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 } 634 }
634 635
635 RenderWidget* RenderFrameImpl::GetRenderWidget() { 636 RenderWidget* RenderFrameImpl::GetRenderWidget() {
636 return render_view_.get(); 637 return render_view_.get();
637 } 638 }
638 639
639 #if defined(ENABLE_PLUGINS) 640 #if defined(ENABLE_PLUGINS)
640 void RenderFrameImpl::PepperPluginCreated(RendererPpapiHost* host) { 641 void RenderFrameImpl::PepperPluginCreated(RendererPpapiHost* host) {
641 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, 642 FOR_EACH_OBSERVER(RenderFrameObserver, observers_,
642 DidCreatePepperPlugin(host)); 643 DidCreatePepperPlugin(host));
644 if (host->GetPluginName() == kFlashPluginName) {
645 RenderThread::Get()->RecordAction(
646 base::UserMetricsAction("FrameLoadWithFlash"));
647 }
643 } 648 }
644 649
645 void RenderFrameImpl::PepperDidChangeCursor( 650 void RenderFrameImpl::PepperDidChangeCursor(
646 PepperPluginInstanceImpl* instance, 651 PepperPluginInstanceImpl* instance,
647 const blink::WebCursorInfo& cursor) { 652 const blink::WebCursorInfo& cursor) {
648 // Update the cursor appearance immediately if the requesting plugin is the 653 // Update the cursor appearance immediately if the requesting plugin is the
649 // one which receives the last mouse event. Otherwise, the new cursor won't be 654 // one which receives the last mouse event. Otherwise, the new cursor won't be
650 // picked up until the plugin gets the next input event. That is bad if, e.g., 655 // picked up until the plugin gets the next input event. That is bad if, e.g.,
651 // the plugin would like to set an invisible cursor when there isn't any user 656 // the plugin would like to set an invisible cursor when there isn't any user
652 // input for a while. 657 // input for a while.
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after
1638 #if defined(ENABLE_PLUGINS) 1643 #if defined(ENABLE_PLUGINS)
1639 WebPluginInfo info; 1644 WebPluginInfo info;
1640 std::string mime_type; 1645 std::string mime_type;
1641 bool found = false; 1646 bool found = false;
1642 Send(new FrameHostMsg_GetPluginInfo( 1647 Send(new FrameHostMsg_GetPluginInfo(
1643 routing_id_, params.url, frame->top()->document().url(), 1648 routing_id_, params.url, frame->top()->document().url(),
1644 params.mimeType.utf8(), &found, &info, &mime_type)); 1649 params.mimeType.utf8(), &found, &info, &mime_type));
1645 if (!found) 1650 if (!found)
1646 return NULL; 1651 return NULL;
1647 1652
1648 if (info.type == content::WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN) { 1653 if (info.type == WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN) {
1649 scoped_ptr<BrowserPluginDelegate> browser_plugin_delegate( 1654 scoped_ptr<BrowserPluginDelegate> browser_plugin_delegate(
1650 GetContentClient()->renderer()->CreateBrowserPluginDelegate( 1655 GetContentClient()->renderer()->CreateBrowserPluginDelegate(
1651 this, base::UTF16ToUTF8(params.mimeType))); 1656 this, base::UTF16ToUTF8(params.mimeType)));
1652 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin( 1657 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin(
1653 render_view_.get(), frame, browser_plugin_delegate.Pass()); 1658 render_view_.get(), frame, browser_plugin_delegate.Pass());
1654 } 1659 }
1655 1660
1656 1661
1657 WebPluginParams params_to_use = params; 1662 WebPluginParams params_to_use = params;
1658 params_to_use.mimeType = WebString::fromUTF8(mime_type); 1663 params_to_use.mimeType = WebString::fromUTF8(mime_type);
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after
2586 RenderWidget::FROM_NON_IME); 2591 RenderWidget::FROM_NON_IME);
2587 #endif 2592 #endif
2588 } 2593 }
2589 2594
2590 blink::WebColorChooser* RenderFrameImpl::createColorChooser( 2595 blink::WebColorChooser* RenderFrameImpl::createColorChooser(
2591 blink::WebColorChooserClient* client, 2596 blink::WebColorChooserClient* client,
2592 const blink::WebColor& initial_color, 2597 const blink::WebColor& initial_color,
2593 const blink::WebVector<blink::WebColorSuggestion>& suggestions) { 2598 const blink::WebVector<blink::WebColorSuggestion>& suggestions) {
2594 RendererWebColorChooserImpl* color_chooser = 2599 RendererWebColorChooserImpl* color_chooser =
2595 new RendererWebColorChooserImpl(this, client); 2600 new RendererWebColorChooserImpl(this, client);
2596 std::vector<content::ColorSuggestion> color_suggestions; 2601 std::vector<ColorSuggestion> color_suggestions;
2597 for (size_t i = 0; i < suggestions.size(); i++) { 2602 for (size_t i = 0; i < suggestions.size(); i++) {
2598 color_suggestions.push_back(content::ColorSuggestion(suggestions[i])); 2603 color_suggestions.push_back(ColorSuggestion(suggestions[i]));
2599 } 2604 }
2600 color_chooser->Open(static_cast<SkColor>(initial_color), color_suggestions); 2605 color_chooser->Open(static_cast<SkColor>(initial_color), color_suggestions);
2601 return color_chooser; 2606 return color_chooser;
2602 } 2607 }
2603 2608
2604 void RenderFrameImpl::runModalAlertDialog(const blink::WebString& message) { 2609 void RenderFrameImpl::runModalAlertDialog(const blink::WebString& message) {
2605 RunJavaScriptMessage(JAVASCRIPT_MESSAGE_TYPE_ALERT, 2610 RunJavaScriptMessage(JAVASCRIPT_MESSAGE_TYPE_ALERT,
2606 message, 2611 message,
2607 base::string16(), 2612 base::string16(),
2608 frame_->document().url(), 2613 frame_->document().url(),
(...skipping 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after
4126 4131
4127 #if defined(ENABLE_BROWSER_CDMS) 4132 #if defined(ENABLE_BROWSER_CDMS)
4128 RendererCdmManager* RenderFrameImpl::GetCdmManager() { 4133 RendererCdmManager* RenderFrameImpl::GetCdmManager() {
4129 if (!cdm_manager_) 4134 if (!cdm_manager_)
4130 cdm_manager_ = new RendererCdmManager(this); 4135 cdm_manager_ = new RendererCdmManager(this);
4131 return cdm_manager_; 4136 return cdm_manager_;
4132 } 4137 }
4133 #endif // defined(ENABLE_BROWSER_CDMS) 4138 #endif // defined(ENABLE_BROWSER_CDMS)
4134 4139
4135 } // namespace content 4140 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698