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

Side by Side Diff: services/ui/common/image_cursors_set.cc

Issue 2916823002: Move Mus into chrome's process when running with --mus.
Patch Set: Removing debug include. Created 3 years, 5 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 | « services/ui/common/image_cursors_set.h ('k') | services/ui/display/screen_manager_forwarding.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "services/ui/common/image_cursors_set.h"
6
7 #include <algorithm>
8
9 #include "ui/base/cursor/image_cursors.h"
10
11 namespace ui {
12
13 ImageCursorsSet::ImageCursorsSet() : weak_ptr_factory_(this) {}
14
15 ImageCursorsSet::~ImageCursorsSet() {}
16
17 void ImageCursorsSet::AddImageCursors(
18 std::unique_ptr<ImageCursors> image_cursors) {
19 auto result = image_cursors_set_.insert(std::move(image_cursors));
20 DCHECK(result.second);
21 }
22
23 void ImageCursorsSet::RemoveImageCursors(ImageCursors* image_cursors) {
24 auto it =
25 std::find_if(image_cursors_set_.begin(), image_cursors_set_.end(),
26 [image_cursors](const std::unique_ptr<ImageCursors>& elmt) {
27 return elmt.get() == image_cursors;
28 });
29 DCHECK(it != image_cursors_set_.end());
30 image_cursors_set_.erase(it);
31 }
32
33 base::WeakPtr<ImageCursorsSet> ImageCursorsSet::GetWeakPtr() {
34 return weak_ptr_factory_.GetWeakPtr();
35 }
36
37 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/common/image_cursors_set.h ('k') | services/ui/display/screen_manager_forwarding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698