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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 871443004: Expose the visibility state of a frame to the browser process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rfh_isfocused
Patch Set: rebase Created 5 years, 11 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 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/browser/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 } 263 }
264 264
265 RenderViewHost* RenderFrameHostImpl::GetRenderViewHost() { 265 RenderViewHost* RenderFrameHostImpl::GetRenderViewHost() {
266 return render_view_host_; 266 return render_view_host_;
267 } 267 }
268 268
269 ServiceRegistry* RenderFrameHostImpl::GetServiceRegistry() { 269 ServiceRegistry* RenderFrameHostImpl::GetServiceRegistry() {
270 return service_registry_.get(); 270 return service_registry_.get();
271 } 271 }
272 272
273 blink::WebPageVisibilityState RenderFrameHostImpl::GetVisibilityState() {
274 blink::WebPageVisibilityState visibility_state =
275 RenderWidgetHostImpl::From(GetView()->GetRenderWidgetHost())->is_hidden()
276 ? blink::WebPageVisibilityStateHidden
277 : blink::WebPageVisibilityStateVisible;
278 GetContentClient()->browser()->OverridePageVisibilityState(this,
279 &visibility_state);
280 return visibility_state;
281 }
282
273 bool RenderFrameHostImpl::Send(IPC::Message* message) { 283 bool RenderFrameHostImpl::Send(IPC::Message* message) {
274 if (IPC_MESSAGE_ID_CLASS(message->type()) == InputMsgStart) { 284 if (IPC_MESSAGE_ID_CLASS(message->type()) == InputMsgStart) {
275 return render_view_host_->input_router()->SendInput( 285 return render_view_host_->input_router()->SendInput(
276 make_scoped_ptr(message)); 286 make_scoped_ptr(message));
277 } 287 }
278 288
279 return GetProcess()->Send(message); 289 return GetProcess()->Send(message);
280 } 290 }
281 291
282 bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) { 292 bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) {
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after
1735 void RenderFrameHostImpl::DidUseGeolocationPermission() { 1745 void RenderFrameHostImpl::DidUseGeolocationPermission() {
1736 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); 1746 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame();
1737 GetContentClient()->browser()->RegisterPermissionUsage( 1747 GetContentClient()->browser()->RegisterPermissionUsage(
1738 PERMISSION_GEOLOCATION, 1748 PERMISSION_GEOLOCATION,
1739 delegate_->GetAsWebContents(), 1749 delegate_->GetAsWebContents(),
1740 GetLastCommittedURL().GetOrigin(), 1750 GetLastCommittedURL().GetOrigin(),
1741 top_frame->GetLastCommittedURL().GetOrigin()); 1751 top_frame->GetLastCommittedURL().GetOrigin());
1742 } 1752 }
1743 1753
1744 } // namespace content 1754 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/frame_host/render_frame_host_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698