Chromium Code Reviews| Index: content/renderer/screen_orientation/mock_screen_orientation_controller.cc |
| diff --git a/content/renderer/screen_orientation/mock_screen_orientation_controller.cc b/content/renderer/screen_orientation/mock_screen_orientation_controller.cc |
| index d16bc74e38d484a85ae12d069d94b877f7bbdace..c475ad9c0db7b7695f8f96ed7bc9059339111f6c 100644 |
| --- a/content/renderer/screen_orientation/mock_screen_orientation_controller.cc |
| +++ b/content/renderer/screen_orientation/mock_screen_orientation_controller.cc |
| @@ -4,7 +4,9 @@ |
| #include "content/renderer/screen_orientation/mock_screen_orientation_controller.h" |
| +#include "base/bind.h" |
| #include "base/logging.h" |
| +#include "base/message_loop/message_loop.h" |
| #include "third_party/WebKit/public/platform/WebScreenOrientationListener.h" |
| namespace content { |
| @@ -14,6 +16,9 @@ MockScreenOrientationController::MockScreenOrientationController() |
| device_orientation_(blink::WebScreenOrientationPortraitPrimary), |
| current_orientation_(blink::WebScreenOrientationPortraitPrimary), |
| listener_(NULL) { |
| + // Since MockScreenOrientationController is held by LazyInstance reference, |
| + // add this ref for it. |
| + AddRef(); |
| } |
| void MockScreenOrientationController::SetListener( |
| @@ -29,6 +34,14 @@ void MockScreenOrientationController::ResetData() { |
| void MockScreenOrientationController::UpdateLock( |
| blink::WebScreenOrientationLockType lock) { |
| + LOG(ERROR) << "MockScreenOrientationController::UpdateLock()"; |
|
Inactive
2014/05/28 11:49:39
I think you meant to remove this logging?
ostap
2014/05/28 14:40:21
Done.
|
| + base::MessageLoop::current()->PostTask( |
| + FROM_HERE, |
| + base::Bind(&MockScreenOrientationController::UpdateLockSync, this, lock)); |
| +} |
| +void MockScreenOrientationController::UpdateLockSync( |
| + blink::WebScreenOrientationLockType lock) { |
| + LOG(ERROR) << "MockScreenOrientationController::UpdateLockSync()"; |
|
Inactive
2014/05/28 11:49:39
ditto.
ostap
2014/05/28 14:40:21
Done.
|
| DCHECK(lock != blink::WebScreenOrientationLockDefault); |
| current_lock_ = lock; |
| if (!IsOrientationAllowedByCurrentLock(current_orientation_)) |
| @@ -36,6 +49,12 @@ void MockScreenOrientationController::UpdateLock( |
| } |
| void MockScreenOrientationController::ResetLock() { |
| + base::MessageLoop::current()->PostTask( |
| + FROM_HERE, |
| + base::Bind(&MockScreenOrientationController::ResetLockSync, this)); |
| +} |
| + |
| +void MockScreenOrientationController::ResetLockSync() { |
| bool will_screen_orientation_need_updating = |
| !IsOrientationAllowedByCurrentLock(device_orientation_); |
| current_lock_ = blink::WebScreenOrientationLockDefault; |