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

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

Issue 347553002: Use WebLockOrientationError instead of WebLockOrientationCallbackErrorType. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup_web_screen_orientation_listener
Patch Set: Created 6 years, 6 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 | content/common/DEPS » ('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 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/web_contents.h" 10 #include "content/public/browser/web_contents.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } 47 }
48 48
49 void ScreenOrientationDispatcherHost::OnLockRequest( 49 void ScreenOrientationDispatcherHost::OnLockRequest(
50 RenderFrameHost* render_frame_host, 50 RenderFrameHost* render_frame_host,
51 blink::WebScreenOrientationLockType orientation, 51 blink::WebScreenOrientationLockType orientation,
52 int request_id) { 52 int request_id) {
53 if (!provider_) { 53 if (!provider_) {
54 render_frame_host->Send(new ScreenOrientationMsg_LockError( 54 render_frame_host->Send(new ScreenOrientationMsg_LockError(
55 render_frame_host->GetRoutingID(), 55 render_frame_host->GetRoutingID(),
56 request_id, 56 request_id,
57 blink::WebLockOrientationCallback::ErrorTypeNotAvailable)); 57 blink::WebLockOrientationErrorNotAvailable));
58 return; 58 return;
59 } 59 }
60 60
61 // TODO(mlamouri): pass real values. 61 // TODO(mlamouri): pass real values.
62 render_frame_host->Send(new ScreenOrientationMsg_LockSuccess( 62 render_frame_host->Send(new ScreenOrientationMsg_LockSuccess(
63 render_frame_host->GetRoutingID(), 63 render_frame_host->GetRoutingID(),
64 request_id, 64 request_id,
65 0, 65 0,
66 blink::WebScreenOrientationPortraitPrimary)); 66 blink::WebScreenOrientationPortraitPrimary));
67 provider_->LockOrientation(orientation); 67 provider_->LockOrientation(orientation);
68 } 68 }
69 69
70 void ScreenOrientationDispatcherHost::OnUnlockRequest( 70 void ScreenOrientationDispatcherHost::OnUnlockRequest(
71 RenderFrameHost* render_frame_host) { 71 RenderFrameHost* render_frame_host) {
72 if (!provider_.get()) 72 if (!provider_.get())
73 return; 73 return;
74 74
75 provider_->UnlockOrientation(); 75 provider_->UnlockOrientation();
76 } 76 }
77 77
78 #if !defined(OS_ANDROID) 78 #if !defined(OS_ANDROID)
79 // static 79 // static
80 ScreenOrientationProvider* ScreenOrientationDispatcherHost::CreateProvider() { 80 ScreenOrientationProvider* ScreenOrientationDispatcherHost::CreateProvider() {
81 return NULL; 81 return NULL;
82 } 82 }
83 #endif 83 #endif
84 84
85 } // namespace content 85 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698