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

Side by Side Diff: ash/test/test_shelf_delegate.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/test/test_session_state_delegate.h ('k') | ash/test/test_shell_delegate.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "ash/test/test_shelf_delegate.h" 5 #include "ash/test/test_shelf_delegate.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/shelf/shelf_item_delegate_manager.h" 9 #include "ash/shelf/shelf_item_delegate_manager.h"
10 #include "ash/shelf/shelf_model.h" 10 #include "ash/shelf/shelf_model.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 else 48 else
49 item.type = TYPE_PLATFORM_APP; 49 item.type = TYPE_PLATFORM_APP;
50 ShelfID id = model_->next_id(); 50 ShelfID id = model_->next_id();
51 item.status = status; 51 item.status = status;
52 model_->Add(item); 52 model_->Add(item);
53 window->AddObserver(this); 53 window->AddObserver(this);
54 54
55 ShelfItemDelegateManager* manager = 55 ShelfItemDelegateManager* manager =
56 Shell::GetInstance()->shelf_item_delegate_manager(); 56 Shell::GetInstance()->shelf_item_delegate_manager();
57 // |manager| owns TestShelfItemDelegate. 57 // |manager| owns TestShelfItemDelegate.
58 scoped_ptr<ShelfItemDelegate> delegate(new TestShelfItemDelegate(window)); 58 std::unique_ptr<ShelfItemDelegate> delegate(
59 new TestShelfItemDelegate(window));
59 manager->SetShelfItemDelegate(id, std::move(delegate)); 60 manager->SetShelfItemDelegate(id, std::move(delegate));
60 SetShelfIDForWindow(id, window); 61 SetShelfIDForWindow(id, window);
61 } 62 }
62 63
63 void TestShelfDelegate::RemoveShelfItemForWindow(aura::Window* window) { 64 void TestShelfDelegate::RemoveShelfItemForWindow(aura::Window* window) {
64 ShelfID shelf_id = GetShelfIDForWindow(window); 65 ShelfID shelf_id = GetShelfIDForWindow(window);
65 if (shelf_id == 0) 66 if (shelf_id == 0)
66 return; 67 return;
67 int index = model_->ItemIndexByID(shelf_id); 68 int index = model_->ItemIndexByID(shelf_id);
68 DCHECK_NE(-1, index); 69 DCHECK_NE(-1, index);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 const std::string& app_id) { 132 const std::string& app_id) {
132 shelf_id_to_app_id_map_[shelf_id] = app_id; 133 shelf_id_to_app_id_map_[shelf_id] = app_id;
133 } 134 }
134 135
135 void TestShelfDelegate::RemoveShelfIDToAppIDMapping(ShelfID shelf_id) { 136 void TestShelfDelegate::RemoveShelfIDToAppIDMapping(ShelfID shelf_id) {
136 shelf_id_to_app_id_map_.erase(shelf_id); 137 shelf_id_to_app_id_map_.erase(shelf_id);
137 } 138 }
138 139
139 } // namespace test 140 } // namespace test
140 } // namespace ash 141 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/test_session_state_delegate.h ('k') | ash/test/test_shell_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698