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

Side by Side Diff: ash/shell/window_watcher.cc

Issue 1867223004: Convert //ash from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments 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 | « ash/shell/window_watcher.h ('k') | ash/shell_init_params.h » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/shell/window_watcher.h" 5 #include "ash/shell/window_watcher.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/display/window_tree_host_manager.h" 9 #include "ash/display/window_tree_host_manager.h"
10 #include "ash/shelf/shelf.h" 10 #include "ash/shelf/shelf.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 image_count == 0 ? 255 : 0, 111 image_count == 0 ? 255 : 0,
112 image_count == 1 ? 255 : 0, 112 image_count == 1 ? 255 : 0,
113 image_count == 2 ? 255 : 0); 113 image_count == 2 ? 255 : 0);
114 image_count = (image_count + 1) % 3; 114 image_count = (image_count + 1) % 3;
115 item.image = gfx::ImageSkia(gfx::ImageSkiaRep(icon_bitmap, 1.0f)); 115 item.image = gfx::ImageSkia(gfx::ImageSkiaRep(icon_bitmap, 1.0f));
116 116
117 model->Add(item); 117 model->Add(item);
118 118
119 ShelfItemDelegateManager* manager = 119 ShelfItemDelegateManager* manager =
120 Shell::GetInstance()->shelf_item_delegate_manager(); 120 Shell::GetInstance()->shelf_item_delegate_manager();
121 scoped_ptr<ShelfItemDelegate> delegate( 121 std::unique_ptr<ShelfItemDelegate> delegate(
122 new WindowWatcherShelfItemDelegate(id, this)); 122 new WindowWatcherShelfItemDelegate(id, this));
123 manager->SetShelfItemDelegate(id, std::move(delegate)); 123 manager->SetShelfItemDelegate(id, std::move(delegate));
124 SetShelfIDForWindow(id, new_window); 124 SetShelfIDForWindow(id, new_window);
125 } 125 }
126 126
127 void WindowWatcher::OnWillRemoveWindow(aura::Window* window) { 127 void WindowWatcher::OnWillRemoveWindow(aura::Window* window) {
128 for (IDToWindow::iterator i = id_to_window_.begin(); 128 for (IDToWindow::iterator i = id_to_window_.begin();
129 i != id_to_window_.end(); ++i) { 129 i != id_to_window_.end(); ++i) {
130 if (i->second == window) { 130 if (i->second == window) {
131 ShelfModel* model = Shell::GetInstance()->shelf_model(); 131 ShelfModel* model = Shell::GetInstance()->shelf_model();
(...skipping 16 matching lines...) Expand all
148 void WindowWatcher::OnDisplayRemoved(const gfx::Display& old_display) { 148 void WindowWatcher::OnDisplayRemoved(const gfx::Display& old_display) {
149 // All windows in the display has already been removed, so no need to 149 // All windows in the display has already been removed, so no need to
150 // remove observers. 150 // remove observers.
151 } 151 }
152 152
153 void WindowWatcher::OnDisplayMetricsChanged(const gfx::Display&, uint32_t) { 153 void WindowWatcher::OnDisplayMetricsChanged(const gfx::Display&, uint32_t) {
154 } 154 }
155 155
156 } // namespace shell 156 } // namespace shell
157 } // namespace ash 157 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell/window_watcher.h ('k') | ash/shell_init_params.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698