| 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 "ash/utility/partial_screenshot_controller.h" | 5 #include "ash/utility/partial_screenshot_controller.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "ash/screenshot_delegate.h" | 9 #include "ash/screenshot_delegate.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 class PartialScreenshotController::ScopedCursorSetter { | 88 class PartialScreenshotController::ScopedCursorSetter { |
| 89 public: | 89 public: |
| 90 ScopedCursorSetter(::wm::CursorManager* cursor_manager, | 90 ScopedCursorSetter(::wm::CursorManager* cursor_manager, |
| 91 gfx::NativeCursor cursor) | 91 gfx::NativeCursor cursor) |
| 92 : cursor_manager_(nullptr) { | 92 : cursor_manager_(nullptr) { |
| 93 if (cursor_manager->IsCursorLocked()) | 93 if (cursor_manager->IsCursorLocked()) |
| 94 return; | 94 return; |
| 95 gfx::NativeCursor original_cursor = cursor_manager->GetCursor(); | 95 gfx::NativeCursor original_cursor = cursor_manager->GetCursor(); |
| 96 cursor_manager_ = cursor_manager; | 96 cursor_manager_ = cursor_manager; |
| 97 cursor_manager_->SetCursor(cursor); | 97 cursor_manager_->SetCursor(cursor); |
| 98 if (!cursor_manager_->IsCursorVisible()) |
| 99 cursor_manager_->ShowCursor(); |
| 98 cursor_manager_->LockCursor(); | 100 cursor_manager_->LockCursor(); |
| 99 // SetCursor does not make any effects at this point but it sets back to the | 101 // SetCursor does not make any effects at this point but it sets back to |
| 100 // original cursor when unlocked. | 102 // the original cursor when unlocked. |
| 101 cursor_manager_->SetCursor(original_cursor); | 103 cursor_manager_->SetCursor(original_cursor); |
| 102 } | 104 } |
| 103 | 105 |
| 104 ~ScopedCursorSetter() { | 106 ~ScopedCursorSetter() { |
| 105 if (cursor_manager_) | 107 if (cursor_manager_) |
| 106 cursor_manager_->UnlockCursor(); | 108 cursor_manager_->UnlockCursor(); |
| 107 } | 109 } |
| 108 | 110 |
| 109 private: | 111 private: |
| 110 ::wm::CursorManager* cursor_manager_; | 112 ::wm::CursorManager* cursor_manager_; |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 return; | 258 return; |
| 257 Cancel(); | 259 Cancel(); |
| 258 } | 260 } |
| 259 | 261 |
| 260 void PartialScreenshotController::OnDisplayMetricsChanged( | 262 void PartialScreenshotController::OnDisplayMetricsChanged( |
| 261 const gfx::Display& display, | 263 const gfx::Display& display, |
| 262 uint32_t changed_metrics) { | 264 uint32_t changed_metrics) { |
| 263 } | 265 } |
| 264 | 266 |
| 265 } // namespace ash | 267 } // namespace ash |
| OLD | NEW |