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

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: rebase 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.h" 56 #include "content/renderer/accessibility/renderer_accessibility.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 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 } 658 }
658 659
659 RenderWidget* RenderFrameImpl::GetRenderWidget() { 660 RenderWidget* RenderFrameImpl::GetRenderWidget() {
660 return render_view_.get(); 661 return render_view_.get();
661 } 662 }
662 663
663 #if defined(ENABLE_PLUGINS) 664 #if defined(ENABLE_PLUGINS)
664 void RenderFrameImpl::PepperPluginCreated(RendererPpapiHost* host) { 665 void RenderFrameImpl::PepperPluginCreated(RendererPpapiHost* host) {
665 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, 666 FOR_EACH_OBSERVER(RenderFrameObserver, observers_,
666 DidCreatePepperPlugin(host)); 667 DidCreatePepperPlugin(host));
668 if (host->GetPluginName() == kFlashPluginName) {
669 RenderThread::Get()->RecordAction(
670 base::UserMetricsAction("FrameLoadWithFlash"));
671 }
667 } 672 }
668 673
669 void RenderFrameImpl::PepperDidChangeCursor( 674 void RenderFrameImpl::PepperDidChangeCursor(
670 PepperPluginInstanceImpl* instance, 675 PepperPluginInstanceImpl* instance,
671 const blink::WebCursorInfo& cursor) { 676 const blink::WebCursorInfo& cursor) {
672 // Update the cursor appearance immediately if the requesting plugin is the 677 // Update the cursor appearance immediately if the requesting plugin is the
673 // one which receives the last mouse event. Otherwise, the new cursor won't be 678 // one which receives the last mouse event. Otherwise, the new cursor won't be
674 // picked up until the plugin gets the next input event. That is bad if, e.g., 679 // picked up until the plugin gets the next input event. That is bad if, e.g.,
675 // the plugin would like to set an invisible cursor when there isn't any user 680 // the plugin would like to set an invisible cursor when there isn't any user
676 // input for a while. 681 // input for a while.
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after
1665 #if defined(ENABLE_PLUGINS) 1670 #if defined(ENABLE_PLUGINS)
1666 WebPluginInfo info; 1671 WebPluginInfo info;
1667 std::string mime_type; 1672 std::string mime_type;
1668 bool found = false; 1673 bool found = false;
1669 Send(new FrameHostMsg_GetPluginInfo( 1674 Send(new FrameHostMsg_GetPluginInfo(
1670 routing_id_, params.url, frame->top()->document().url(), 1675 routing_id_, params.url, frame->top()->document().url(),
1671 params.mimeType.utf8(), &found, &info, &mime_type)); 1676 params.mimeType.utf8(), &found, &info, &mime_type));
1672 if (!found) 1677 if (!found)
1673 return NULL; 1678 return NULL;
1674 1679
1675 if (info.type == content::WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN) { 1680 if (info.type == WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN) {
1676 scoped_ptr<BrowserPluginDelegate> browser_plugin_delegate( 1681 scoped_ptr<BrowserPluginDelegate> browser_plugin_delegate(
1677 GetContentClient()->renderer()->CreateBrowserPluginDelegate( 1682 GetContentClient()->renderer()->CreateBrowserPluginDelegate(
1678 this, base::UTF16ToUTF8(params.mimeType))); 1683 this, base::UTF16ToUTF8(params.mimeType)));
1679 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin( 1684 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin(
1680 render_view_.get(), frame, browser_plugin_delegate.Pass()); 1685 render_view_.get(), frame, browser_plugin_delegate.Pass());
1681 } 1686 }
1682 1687
1683 1688
1684 WebPluginParams params_to_use = params; 1689 WebPluginParams params_to_use = params;
1685 params_to_use.mimeType = WebString::fromUTF8(mime_type); 1690 params_to_use.mimeType = WebString::fromUTF8(mime_type);
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
2621 RenderWidget::FROM_NON_IME); 2626 RenderWidget::FROM_NON_IME);
2622 #endif 2627 #endif
2623 } 2628 }
2624 2629
2625 blink::WebColorChooser* RenderFrameImpl::createColorChooser( 2630 blink::WebColorChooser* RenderFrameImpl::createColorChooser(
2626 blink::WebColorChooserClient* client, 2631 blink::WebColorChooserClient* client,
2627 const blink::WebColor& initial_color, 2632 const blink::WebColor& initial_color,
2628 const blink::WebVector<blink::WebColorSuggestion>& suggestions) { 2633 const blink::WebVector<blink::WebColorSuggestion>& suggestions) {
2629 RendererWebColorChooserImpl* color_chooser = 2634 RendererWebColorChooserImpl* color_chooser =
2630 new RendererWebColorChooserImpl(this, client); 2635 new RendererWebColorChooserImpl(this, client);
2631 std::vector<content::ColorSuggestion> color_suggestions; 2636 std::vector<ColorSuggestion> color_suggestions;
2632 for (size_t i = 0; i < suggestions.size(); i++) { 2637 for (size_t i = 0; i < suggestions.size(); i++) {
2633 color_suggestions.push_back(content::ColorSuggestion(suggestions[i])); 2638 color_suggestions.push_back(ColorSuggestion(suggestions[i]));
2634 } 2639 }
2635 color_chooser->Open(static_cast<SkColor>(initial_color), color_suggestions); 2640 color_chooser->Open(static_cast<SkColor>(initial_color), color_suggestions);
2636 return color_chooser; 2641 return color_chooser;
2637 } 2642 }
2638 2643
2639 void RenderFrameImpl::runModalAlertDialog(const blink::WebString& message) { 2644 void RenderFrameImpl::runModalAlertDialog(const blink::WebString& message) {
2640 RunJavaScriptMessage(JAVASCRIPT_MESSAGE_TYPE_ALERT, 2645 RunJavaScriptMessage(JAVASCRIPT_MESSAGE_TYPE_ALERT,
2641 message, 2646 message,
2642 base::string16(), 2647 base::string16(),
2643 frame_->document().url(), 2648 frame_->document().url(),
(...skipping 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after
4163 4168
4164 #if defined(ENABLE_BROWSER_CDMS) 4169 #if defined(ENABLE_BROWSER_CDMS)
4165 RendererCdmManager* RenderFrameImpl::GetCdmManager() { 4170 RendererCdmManager* RenderFrameImpl::GetCdmManager() {
4166 if (!cdm_manager_) 4171 if (!cdm_manager_)
4167 cdm_manager_ = new RendererCdmManager(this); 4172 cdm_manager_ = new RendererCdmManager(this);
4168 return cdm_manager_; 4173 return cdm_manager_;
4169 } 4174 }
4170 #endif // defined(ENABLE_BROWSER_CDMS) 4175 #endif // defined(ENABLE_BROWSER_CDMS)
4171 4176
4172 } // namespace content 4177 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_plugin_instance_impl.cc ('k') | tools/metrics/actions/actions.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698