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

Side by Side Diff: ui/wm/core/cursor_manager.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 years, 8 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 | « ui/wm/core/cursor_manager.h ('k') | ui/wm/core/cursor_manager_unittest.cc » ('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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "ui/wm/core/cursor_manager.h" 5 #include "ui/wm/core/cursor_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 // The visibility to set when mouse events are enabled. 68 // The visibility to set when mouse events are enabled.
69 bool visible_on_mouse_events_enabled_; 69 bool visible_on_mouse_events_enabled_;
70 70
71 DISALLOW_COPY_AND_ASSIGN(CursorState); 71 DISALLOW_COPY_AND_ASSIGN(CursorState);
72 }; 72 };
73 73
74 } // namespace internal 74 } // namespace internal
75 75
76 bool CursorManager::last_cursor_visibility_state_ = true; 76 bool CursorManager::last_cursor_visibility_state_ = true;
77 77
78 CursorManager::CursorManager(scoped_ptr<NativeCursorManager> delegate) 78 CursorManager::CursorManager(std::unique_ptr<NativeCursorManager> delegate)
79 : delegate_(std::move(delegate)), 79 : delegate_(std::move(delegate)),
80 cursor_lock_count_(0), 80 cursor_lock_count_(0),
81 current_state_(new internal::CursorState), 81 current_state_(new internal::CursorState),
82 state_on_unlock_(new internal::CursorState) { 82 state_on_unlock_(new internal::CursorState) {
83 // Restore the last cursor visibility state. 83 // Restore the last cursor visibility state.
84 current_state_->SetVisible(last_cursor_visibility_state_); 84 current_state_->SetVisible(last_cursor_visibility_state_);
85 } 85 }
86 86
87 CursorManager::~CursorManager() { 87 CursorManager::~CursorManager() {
88 } 88 }
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 217
218 void CursorManager::CommitCursorSet(ui::CursorSetType cursor_set) { 218 void CursorManager::CommitCursorSet(ui::CursorSetType cursor_set) {
219 current_state_->set_cursor_set(cursor_set); 219 current_state_->set_cursor_set(cursor_set);
220 } 220 }
221 221
222 void CursorManager::CommitMouseEventsEnabled(bool enabled) { 222 void CursorManager::CommitMouseEventsEnabled(bool enabled) {
223 current_state_->SetMouseEventsEnabled(enabled); 223 current_state_->SetMouseEventsEnabled(enabled);
224 } 224 }
225 225
226 } // namespace wm 226 } // namespace wm
OLDNEW
« no previous file with comments | « ui/wm/core/cursor_manager.h ('k') | ui/wm/core/cursor_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698