| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/screen_orientation/screen_orientation_dispatcher_host_
impl.h" | 5 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host_
impl.h" |
| 6 | 6 |
| 7 #include "content/common/screen_orientation_messages.h" | 7 #include "content/common/screen_orientation_messages.h" |
| 8 #include "content/public/browser/navigation_details.h" | 8 #include "content/public/browser/navigation_details.h" |
| 9 #include "content/public/browser/render_frame_host.h" | 9 #include "content/public/browser/render_frame_host.h" |
| 10 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
| 11 #include "content/public/browser/render_view_host.h" | 11 #include "content/public/browser/render_view_host.h" |
| 12 #include "content/public/browser/render_widget_host.h" | 12 #include "content/public/browser/render_widget_host.h" |
| 13 #include "content/public/browser/screen_orientation_provider.h" | 13 #include "content/public/browser/screen_orientation_provider.h" |
| 14 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
| 15 #include "third_party/WebKit/public/platform/WebScreenInfo.h" | 15 #include "third_party/WebKit/public/platform/WebScreenInfo.h" |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 | 18 |
| 19 ScreenOrientationDispatcherHostImpl::LockInformation::LockInformation( | 19 ScreenOrientationDispatcherHostImpl::LockInformation::LockInformation( |
| 20 int request_id, int process_id, int routing_id) | 20 int request_id, int process_id, int routing_id) |
| 21 : request_id(request_id), | 21 : request_id(request_id), |
| 22 process_id(process_id), | 22 process_id(process_id), |
| 23 routing_id(routing_id) { | 23 routing_id(routing_id) { |
| 24 } | 24 } |
| 25 | 25 |
| 26 ScreenOrientationDispatcherHostImpl::ScreenOrientationDispatcherHostImpl( | 26 ScreenOrientationDispatcherHostImpl::ScreenOrientationDispatcherHostImpl( |
| 27 WebContents* web_contents) | 27 WebContents* web_contents) |
| 28 : WebContentsObserver(web_contents), | 28 : WebContentsObserver(web_contents), |
| 29 current_lock_(NULL) { | 29 current_lock_(NULL) { |
| 30 provider_.reset(ScreenOrientationProvider::Create(this, web_contents)); | 30 provider_.reset(new ScreenOrientationProvider(this, web_contents)); |
| 31 } | 31 } |
| 32 | 32 |
| 33 ScreenOrientationDispatcherHostImpl::~ScreenOrientationDispatcherHostImpl() { | 33 ScreenOrientationDispatcherHostImpl::~ScreenOrientationDispatcherHostImpl() { |
| 34 ResetCurrentLock(); | 34 ResetCurrentLock(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 void ScreenOrientationDispatcherHostImpl::ResetCurrentLock() { | 37 void ScreenOrientationDispatcherHostImpl::ResetCurrentLock() { |
| 38 if (current_lock_) { | 38 if (current_lock_) { |
| 39 delete current_lock_; | 39 delete current_lock_; |
| 40 current_lock_ = 0; | 40 current_lock_ = 0; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 blink::WebLockOrientationErrorCanceled); | 137 blink::WebLockOrientationErrorCanceled); |
| 138 } | 138 } |
| 139 | 139 |
| 140 if (!provider_) | 140 if (!provider_) |
| 141 return; | 141 return; |
| 142 | 142 |
| 143 provider_->UnlockOrientation(); | 143 provider_->UnlockOrientation(); |
| 144 } | 144 } |
| 145 | 145 |
| 146 } // namespace content | 146 } // namespace content |
| OLD | NEW |