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

Side by Side Diff: content/browser/screen_orientation/screen_orientation_dispatcher_host.cc

Issue 408213003: Cleanups in ScreenOrientationDispatcherHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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. h" 5 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host. h"
6 6
7 #include "content/browser/screen_orientation/screen_orientation_provider.h" 7 #include "content/browser/screen_orientation/screen_orientation_provider.h"
8 #include "content/common/screen_orientation_messages.h" 8 #include "content/common/screen_orientation_messages.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"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 95
96 void ScreenOrientationDispatcherHost::OnLockRequest( 96 void ScreenOrientationDispatcherHost::OnLockRequest(
97 RenderFrameHost* render_frame_host, 97 RenderFrameHost* render_frame_host,
98 blink::WebScreenOrientationLockType orientation, 98 blink::WebScreenOrientationLockType orientation,
99 int request_id) { 99 int request_id) {
100 if (current_lock_) { 100 if (current_lock_) {
101 NotifyLockError(current_lock_->request_id, 101 NotifyLockError(current_lock_->request_id,
102 blink::WebLockOrientationErrorCanceled); 102 blink::WebLockOrientationErrorCanceled);
103 } 103 }
104 104
105 current_lock_ = new LockInformation(request_id,
106 render_frame_host->GetProcess()->GetID(),
107 render_frame_host->GetRoutingID());
108
109 if (!provider_) { 105 if (!provider_) {
110 NotifyLockError(request_id, 106 NotifyLockError(request_id,
111 blink::WebLockOrientationErrorNotAvailable); 107 blink::WebLockOrientationErrorNotAvailable);
112 return; 108 return;
113 } 109 }
114 110
111 current_lock_ = new LockInformation(request_id,
112 render_frame_host->GetProcess()->GetID(),
113 render_frame_host->GetRoutingID());
114
115 provider_->LockOrientation(request_id, orientation); 115 provider_->LockOrientation(request_id, orientation);
116 } 116 }
117 117
118 void ScreenOrientationDispatcherHost::OnUnlockRequest( 118 void ScreenOrientationDispatcherHost::OnUnlockRequest(
119 RenderFrameHost* render_frame_host) { 119 RenderFrameHost* render_frame_host) {
120 if (current_lock_) { 120 if (current_lock_) {
121 NotifyLockError(current_lock_->request_id, 121 NotifyLockError(current_lock_->request_id,
122 blink::WebLockOrientationErrorCanceled); 122 blink::WebLockOrientationErrorCanceled);
123 } 123 }
124 124
125 if (!provider_.get()) 125 if (!provider_)
126 return; 126 return;
127 127
128 provider_->UnlockOrientation(); 128 provider_->UnlockOrientation();
129 } 129 }
130 130
131 } // namespace content 131 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698