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

Side by Side Diff: ash/mus/shelf_delegate_mus.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: 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/mus/shelf_delegate_mus.h" 5 #include "ash/mus/shelf_delegate_mus.h"
6 6
oshima 2016/04/08 07:09:40 include?
7 #include "ash/shelf/shelf.h" 7 #include "ash/shelf/shelf.h"
8 #include "ash/shelf/shelf_item_delegate.h" 8 #include "ash/shelf/shelf_item_delegate.h"
9 #include "ash/shelf/shelf_item_delegate_manager.h" 9 #include "ash/shelf/shelf_item_delegate_manager.h"
10 #include "ash/shelf/shelf_layout_manager.h" 10 #include "ash/shelf/shelf_layout_manager.h"
11 #include "ash/shelf/shelf_model.h" 11 #include "ash/shelf/shelf_model.h"
12 #include "ash/shelf/shelf_widget.h" 12 #include "ash/shelf/shelf_widget.h"
13 #include "ash/shell.h" 13 #include "ash/shell.h"
14 #include "base/strings/string_util.h" 14 #include "base/strings/string_util.h"
15 #include "components/mus/public/cpp/property_type_converters.h" 15 #include "components/mus/public/cpp/property_type_converters.h"
16 #include "components/mus/public/cpp/window.h" 16 #include "components/mus/public/cpp/window.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 item.status = user_window->window_has_focus ? STATUS_ACTIVE : STATUS_RUNNING; 179 item.status = user_window->window_has_focus ? STATUS_ACTIVE : STATUS_RUNNING;
180 item.image = GetShelfIconFromBitmap(user_window->window_app_icon); 180 item.image = GetShelfIconFromBitmap(user_window->window_app_icon);
181 181
182 ShelfID shelf_id = model_->next_id(); 182 ShelfID shelf_id = model_->next_id();
183 window_id_to_shelf_id_.insert( 183 window_id_to_shelf_id_.insert(
184 std::make_pair(user_window->window_id, shelf_id)); 184 std::make_pair(user_window->window_id, shelf_id));
185 model_->Add(item); 185 model_->Add(item);
186 186
187 ShelfItemDelegateManager* manager = 187 ShelfItemDelegateManager* manager =
188 Shell::GetInstance()->shelf_item_delegate_manager(); 188 Shell::GetInstance()->shelf_item_delegate_manager();
189 scoped_ptr<ShelfItemDelegate> delegate(new ShelfItemDelegateMus( 189 std::unique_ptr<ShelfItemDelegate> delegate(new ShelfItemDelegateMus(
190 user_window->window_id, user_window->window_title.To<base::string16>(), 190 user_window->window_id, user_window->window_title.To<base::string16>(),
191 user_window_controller_.get())); 191 user_window_controller_.get()));
192 manager->SetShelfItemDelegate(shelf_id, std::move(delegate)); 192 manager->SetShelfItemDelegate(shelf_id, std::move(delegate));
193 } 193 }
194 194
195 void ShelfDelegateMus::OnUserWindowRemoved(uint32_t window_id) { 195 void ShelfDelegateMus::OnUserWindowRemoved(uint32_t window_id) {
196 DCHECK(window_id_to_shelf_id_.count(window_id)); 196 DCHECK(window_id_to_shelf_id_.count(window_id));
197 model_->RemoveItemAt( 197 model_->RemoveItemAt(
198 model_->ItemIndexByID(window_id_to_shelf_id_[window_id])); 198 model_->ItemIndexByID(window_id_to_shelf_id_[window_id]));
199 } 199 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 DCHECK_GE(index, 0); 244 DCHECK_GE(index, 0);
245 ShelfItems::const_iterator iter = model_->ItemByID(shelf_id); 245 ShelfItems::const_iterator iter = model_->ItemByID(shelf_id);
246 DCHECK(iter != model_->items().end()); 246 DCHECK(iter != model_->items().end());
247 ShelfItem item = *iter; 247 ShelfItem item = *iter;
248 item.status = has_focus ? STATUS_ACTIVE : STATUS_RUNNING; 248 item.status = has_focus ? STATUS_ACTIVE : STATUS_RUNNING;
249 model_->Set(index, item); 249 model_->Set(index, item);
250 } 250 }
251 251
252 } // namespace sysui 252 } // namespace sysui
253 } // namespace ash 253 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698