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

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

Issue 1345563002: Revert of Wake Lock API implementation (Chromium part) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/common/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 #include "content/browser/plugin_content_origin_whitelist.h" 51 #include "content/browser/plugin_content_origin_whitelist.h"
52 #include "content/browser/power_save_blocker_impl.h" 52 #include "content/browser/power_save_blocker_impl.h"
53 #include "content/browser/renderer_host/render_process_host_impl.h" 53 #include "content/browser/renderer_host/render_process_host_impl.h"
54 #include "content/browser/renderer_host/render_view_host_delegate_view.h" 54 #include "content/browser/renderer_host/render_view_host_delegate_view.h"
55 #include "content/browser/renderer_host/render_view_host_impl.h" 55 #include "content/browser/renderer_host/render_view_host_impl.h"
56 #include "content/browser/renderer_host/render_widget_host_impl.h" 56 #include "content/browser/renderer_host/render_widget_host_impl.h"
57 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" 57 #include "content/browser/renderer_host/render_widget_host_input_event_router.h"
58 #include "content/browser/renderer_host/render_widget_host_view_base.h" 58 #include "content/browser/renderer_host/render_widget_host_view_base.h"
59 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host_ impl.h" 59 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host_ impl.h"
60 #include "content/browser/site_instance_impl.h" 60 #include "content/browser/site_instance_impl.h"
61 #include "content/browser/wake_lock/wake_lock_service_context.h"
62 #include "content/browser/web_contents/web_contents_view_guest.h" 61 #include "content/browser/web_contents/web_contents_view_guest.h"
63 #include "content/browser/webui/generic_handler.h" 62 #include "content/browser/webui/generic_handler.h"
64 #include "content/browser/webui/web_ui_controller_factory_registry.h" 63 #include "content/browser/webui/web_ui_controller_factory_registry.h"
65 #include "content/browser/webui/web_ui_impl.h" 64 #include "content/browser/webui/web_ui_impl.h"
66 #include "content/common/browser_plugin/browser_plugin_constants.h" 65 #include "content/common/browser_plugin/browser_plugin_constants.h"
67 #include "content/common/browser_plugin/browser_plugin_messages.h" 66 #include "content/common/browser_plugin/browser_plugin_messages.h"
68 #include "content/common/frame_messages.h" 67 #include "content/common/frame_messages.h"
69 #include "content/common/input_messages.h" 68 #include "content/common/input_messages.h"
70 #include "content/common/site_isolation_policy.h" 69 #include "content/common/site_isolation_policy.h"
71 #include "content/common/ssl_status_serialization.h" 70 #include "content/common/ssl_status_serialization.h"
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()), 405 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()),
407 audio_stream_monitor_(this), 406 audio_stream_monitor_(this),
408 virtual_keyboard_requested_(false), 407 virtual_keyboard_requested_(false),
409 loading_weak_factory_(this) { 408 loading_weak_factory_(this) {
410 frame_tree_.SetFrameRemoveListener( 409 frame_tree_.SetFrameRemoveListener(
411 base::Bind(&WebContentsImpl::OnFrameRemoved, 410 base::Bind(&WebContentsImpl::OnFrameRemoved,
412 base::Unretained(this))); 411 base::Unretained(this)));
413 #if defined(ENABLE_BROWSER_CDMS) 412 #if defined(ENABLE_BROWSER_CDMS)
414 media_web_contents_observer_.reset(new MediaWebContentsObserver(this)); 413 media_web_contents_observer_.reset(new MediaWebContentsObserver(this));
415 #endif 414 #endif
416
417 wake_lock_service_context_.reset(new WakeLockServiceContext(this));
418 } 415 }
419 416
420 WebContentsImpl::~WebContentsImpl() { 417 WebContentsImpl::~WebContentsImpl() {
421 is_being_destroyed_ = true; 418 is_being_destroyed_ = true;
422 419
423 rwh_input_event_router_.reset(); 420 rwh_input_event_router_.reset();
424 421
425 // Delete all RFH pending shutdown, which will lead the corresponding RVH to 422 // Delete all RFH pending shutdown, which will lead the corresponding RVH to
426 // shutdown and be deleted as well. 423 // shutdown and be deleted as well.
427 frame_tree_.ForEach( 424 frame_tree_.ForEach(
(...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after
2055 if (!guest) 2052 if (!guest)
2056 return nullptr; 2053 return nullptr;
2057 2054
2058 return guest->GetMainFrame(); 2055 return guest->GetMainFrame();
2059 } 2056 }
2060 2057
2061 GeolocationServiceContext* WebContentsImpl::GetGeolocationServiceContext() { 2058 GeolocationServiceContext* WebContentsImpl::GetGeolocationServiceContext() {
2062 return geolocation_service_context_.get(); 2059 return geolocation_service_context_.get();
2063 } 2060 }
2064 2061
2065 WakeLockServiceContext* WebContentsImpl::GetWakeLockServiceContext() {
2066 return wake_lock_service_context_.get();
2067 }
2068
2069 void WebContentsImpl::OnShowValidationMessage( 2062 void WebContentsImpl::OnShowValidationMessage(
2070 const gfx::Rect& anchor_in_root_view, 2063 const gfx::Rect& anchor_in_root_view,
2071 const base::string16& main_text, 2064 const base::string16& main_text,
2072 const base::string16& sub_text) { 2065 const base::string16& sub_text) {
2073 if (delegate_) 2066 if (delegate_)
2074 delegate_->ShowValidationMessage( 2067 delegate_->ShowValidationMessage(
2075 this, anchor_in_root_view, main_text, sub_text); 2068 this, anchor_in_root_view, main_text, sub_text);
2076 } 2069 }
2077 2070
2078 void WebContentsImpl::OnHideValidationMessage() { 2071 void WebContentsImpl::OnHideValidationMessage() {
(...skipping 2555 matching lines...) Expand 10 before | Expand all | Expand 10 after
4634 return NULL; 4627 return NULL;
4635 } 4628 }
4636 4629
4637 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4630 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4638 force_disable_overscroll_content_ = force_disable; 4631 force_disable_overscroll_content_ = force_disable;
4639 if (view_) 4632 if (view_)
4640 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4633 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4641 } 4634 }
4642 4635
4643 } // namespace content 4636 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698