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

Unified Diff: content/renderer/screen_orientation/screen_orientation_observer.cc

Issue 2578503002: [DeviceService] Mojofy left screen orientation IPC messages. (Closed)
Patch Set: Address comments from mlamouri@ Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/screen_orientation/screen_orientation_observer.cc
diff --git a/content/renderer/screen_orientation/screen_orientation_observer.cc b/content/renderer/screen_orientation/screen_orientation_observer.cc
index 8cb05fe386946bf7b154cd951bc6bd7a35d12d6c..c4126c5ced6b148de70830b6b6e244033d5ae8f5 100644
--- a/content/renderer/screen_orientation/screen_orientation_observer.cc
+++ b/content/renderer/screen_orientation/screen_orientation_observer.cc
@@ -4,7 +4,7 @@
#include "content/renderer/screen_orientation/screen_orientation_observer.h"
-#include "content/common/screen_orientation_messages.h"
+#include "content/renderer/render_thread_impl.h"
namespace content {
@@ -23,11 +23,20 @@ void ScreenOrientationObserver::Start(
}
void ScreenOrientationObserver::SendStartMessage() {
- RenderThread::Get()->Send(new ScreenOrientationHostMsg_StartListening());
+ GetScreenOrientationAccurate()->StartListening();
}
void ScreenOrientationObserver::SendStopMessage() {
- RenderThread::Get()->Send(new ScreenOrientationHostMsg_StopListening());
+ GetScreenOrientationAccurate()->StopListening();
+}
+
+device::mojom::ScreenOrientationAccurate*
+ScreenOrientationObserver::GetScreenOrientationAccurate() {
+ if (!screen_orientation_accurate_) {
+ RenderThreadImpl::current()->GetChannel()->GetRemoteAssociatedInterface(
+ &screen_orientation_accurate_);
+ }
+ return screen_orientation_accurate_.get();
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698