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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2877333004: UMA for measuring how often 2 or more tabs script the same background contents.
Patch Set: No PostDelayedTask and checking if opener is a hosted app Created 3 years, 7 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
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/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <utility> 10 #include <utility>
(...skipping 4910 matching lines...) Expand 10 before | Expand all | Expand 10 after
4921 GetMainFrame()->GetRenderWidgetHost()->SetPageFocus(true); 4921 GetMainFrame()->GetRenderWidgetHost()->SetPageFocus(true);
4922 } 4922 }
4923 } 4923 }
4924 4924
4925 void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node, 4925 void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node,
4926 SiteInstance* source) { 4926 SiteInstance* source) {
4927 SetAsFocusedWebContentsIfNecessary(); 4927 SetAsFocusedWebContentsIfNecessary();
4928 frame_tree_.SetFocusedFrame(node, source); 4928 frame_tree_.SetFocusedFrame(node, source);
4929 } 4929 }
4930 4930
4931 void WebContentsImpl::DidChangeOpener(FrameTreeNode* node,
4932 FrameTreeNode* opener) {
4933 if (!node->IsMainFrame())
4934 return;
4935
4936 DCHECK_EQ(GetOpener(), opener->current_frame_host());
4937 for (auto& observer : observers_)
4938 observer.DidChangeOpener();
4939 }
4940
4931 void WebContentsImpl::OnFocusedElementChangedInFrame( 4941 void WebContentsImpl::OnFocusedElementChangedInFrame(
4932 RenderFrameHostImpl* frame, 4942 RenderFrameHostImpl* frame,
4933 const gfx::Rect& bounds_in_root_view) { 4943 const gfx::Rect& bounds_in_root_view) {
4934 RenderWidgetHostViewBase* root_view = 4944 RenderWidgetHostViewBase* root_view =
4935 static_cast<RenderWidgetHostViewBase*>(GetRenderWidgetHostView()); 4945 static_cast<RenderWidgetHostViewBase*>(GetRenderWidgetHostView());
4936 if (!root_view || !frame->GetView()) 4946 if (!root_view || !frame->GetView())
4937 return; 4947 return;
4938 4948
4939 // Converting to screen coordinates. 4949 // Converting to screen coordinates.
4940 gfx::Point origin = bounds_in_root_view.origin(); 4950 gfx::Point origin = bounds_in_root_view.origin();
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
5614 new_root->SetOriginalOpener(opener->frame_tree()->root()); 5624 new_root->SetOriginalOpener(opener->frame_tree()->root());
5615 5625
5616 if (!opener_suppressed) { 5626 if (!opener_suppressed) {
5617 new_root->SetOpener(opener); 5627 new_root->SetOpener(opener);
5618 created_with_opener_ = true; 5628 created_with_opener_ = true;
5619 } 5629 }
5620 } 5630 }
5621 } 5631 }
5622 5632
5623 } // namespace content 5633 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/web_contents_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698