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

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

Issue 1393203004: Reland of Wake Lock API implementation (Chromium part) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix presubmit errors Created 5 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/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 24 matching lines...) Expand all
35 #include "content/browser/permissions/permission_service_impl.h" 35 #include "content/browser/permissions/permission_service_impl.h"
36 #include "content/browser/presentation/presentation_service_impl.h" 36 #include "content/browser/presentation/presentation_service_impl.h"
37 #include "content/browser/renderer_host/input/input_router.h" 37 #include "content/browser/renderer_host/input/input_router.h"
38 #include "content/browser/renderer_host/input/timeout_monitor.h" 38 #include "content/browser/renderer_host/input/timeout_monitor.h"
39 #include "content/browser/renderer_host/render_process_host_impl.h" 39 #include "content/browser/renderer_host/render_process_host_impl.h"
40 #include "content/browser/renderer_host/render_view_host_delegate.h" 40 #include "content/browser/renderer_host/render_view_host_delegate.h"
41 #include "content/browser/renderer_host/render_view_host_delegate_view.h" 41 #include "content/browser/renderer_host/render_view_host_delegate_view.h"
42 #include "content/browser/renderer_host/render_view_host_impl.h" 42 #include "content/browser/renderer_host/render_view_host_impl.h"
43 #include "content/browser/renderer_host/render_widget_host_impl.h" 43 #include "content/browser/renderer_host/render_widget_host_impl.h"
44 #include "content/browser/renderer_host/render_widget_host_view_base.h" 44 #include "content/browser/renderer_host/render_widget_host_view_base.h"
45 #include "content/browser/wake_lock/wake_lock_service_context.h"
45 #include "content/common/accessibility_messages.h" 46 #include "content/common/accessibility_messages.h"
46 #include "content/common/frame_messages.h" 47 #include "content/common/frame_messages.h"
47 #include "content/common/input_messages.h" 48 #include "content/common/input_messages.h"
48 #include "content/common/inter_process_time_ticks_converter.h" 49 #include "content/common/inter_process_time_ticks_converter.h"
49 #include "content/common/navigation_params.h" 50 #include "content/common/navigation_params.h"
50 #include "content/common/render_frame_setup.mojom.h" 51 #include "content/common/render_frame_setup.mojom.h"
51 #include "content/common/site_isolation_policy.h" 52 #include "content/common/site_isolation_policy.h"
52 #include "content/common/swapped_out_messages.h" 53 #include "content/common/swapped_out_messages.h"
53 #include "content/public/browser/ax_event_notification_details.h" 54 #include "content/public/browser/ax_event_notification_details.h"
54 #include "content/public/browser/browser_accessibility_state.h" 55 #include "content/public/browser/browser_accessibility_state.h"
(...skipping 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after
1603 // TODO(creis): Bind process ID here so that GeolocationServiceImpl 1604 // TODO(creis): Bind process ID here so that GeolocationServiceImpl
1604 // can perform permissions checks once site isolation is complete. 1605 // can perform permissions checks once site isolation is complete.
1605 // crbug.com/426384 1606 // crbug.com/426384
1606 GetServiceRegistry()->AddService<GeolocationService>( 1607 GetServiceRegistry()->AddService<GeolocationService>(
1607 base::Bind(&GeolocationServiceContext::CreateService, 1608 base::Bind(&GeolocationServiceContext::CreateService,
1608 base::Unretained(geolocation_service_context), 1609 base::Unretained(geolocation_service_context),
1609 base::Bind(&RenderFrameHostImpl::DidUseGeolocationPermission, 1610 base::Bind(&RenderFrameHostImpl::DidUseGeolocationPermission,
1610 base::Unretained(this)))); 1611 base::Unretained(this))));
1611 } 1612 }
1612 1613
1614 WakeLockServiceContext* wake_lock_service_context =
1615 delegate_ ? delegate_->GetWakeLockServiceContext() : nullptr;
1616 if (wake_lock_service_context) {
1617 // WakeLockServiceContext is owned by WebContentsImpl so it will outlive
1618 // this RenderFrameHostImpl, hence a raw pointer can be bound to service
1619 // factory callback.
1620 GetServiceRegistry()->AddService<WakeLockService>(
1621 base::Bind(&WakeLockServiceContext::CreateService,
1622 base::Unretained(wake_lock_service_context),
1623 GetProcess()->GetID(), GetRoutingID()));
1624 }
1625
1613 if (!permission_service_context_) 1626 if (!permission_service_context_)
1614 permission_service_context_.reset(new PermissionServiceContext(this)); 1627 permission_service_context_.reset(new PermissionServiceContext(this));
1615 1628
1616 GetServiceRegistry()->AddService<PermissionService>( 1629 GetServiceRegistry()->AddService<PermissionService>(
1617 base::Bind(&PermissionServiceContext::CreateService, 1630 base::Bind(&PermissionServiceContext::CreateService,
1618 base::Unretained(permission_service_context_.get()))); 1631 base::Unretained(permission_service_context_.get())));
1619 1632
1620 GetServiceRegistry()->AddService<presentation::PresentationService>( 1633 GetServiceRegistry()->AddService<presentation::PresentationService>(
1621 base::Bind(&PresentationServiceImpl::CreateMojoService, 1634 base::Bind(&PresentationServiceImpl::CreateMojoService,
1622 base::Unretained(this))); 1635 base::Unretained(this)));
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
2267 BrowserPluginInstanceIDToAXTreeID(value))); 2280 BrowserPluginInstanceIDToAXTreeID(value)));
2268 break; 2281 break;
2269 case AX_CONTENT_INT_ATTRIBUTE_LAST: 2282 case AX_CONTENT_INT_ATTRIBUTE_LAST:
2270 NOTREACHED(); 2283 NOTREACHED();
2271 break; 2284 break;
2272 } 2285 }
2273 } 2286 }
2274 } 2287 }
2275 2288
2276 } // namespace content 2289 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_delegate.cc ('k') | content/browser/wake_lock/wake_lock_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698