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

Side by Side Diff: ash/common/shelf/shelf_model_unittest.cc

Issue 2171813004: mash: Fold ShelfItemDelegateManager into ShelfModel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: explicitly destroy ShelfItemDelegates Created 4 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 | « ash/common/shelf/shelf_model_observer.h ('k') | ash/common/wm_shell.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 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/common/shelf/shelf_model.h" 5 #include "ash/common/shelf/shelf_model.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "ash/common/shelf/shelf_model_observer.h" 10 #include "ash/common/shelf/shelf_model_observer.h"
(...skipping 27 matching lines...) Expand all
38 38
39 // ShelfModelObserver overrides: 39 // ShelfModelObserver overrides:
40 void ShelfItemAdded(int index) override { added_count_++; } 40 void ShelfItemAdded(int index) override { added_count_++; }
41 void ShelfItemRemoved(int index, ShelfID id) override { removed_count_++; } 41 void ShelfItemRemoved(int index, ShelfID id) override { removed_count_++; }
42 void ShelfItemChanged(int index, const ShelfItem& old_item) override { 42 void ShelfItemChanged(int index, const ShelfItem& old_item) override {
43 changed_count_++; 43 changed_count_++;
44 } 44 }
45 void ShelfItemMoved(int start_index, int target_index) override { 45 void ShelfItemMoved(int start_index, int target_index) override {
46 moved_count_++; 46 moved_count_++;
47 } 47 }
48 void OnSetShelfItemDelegate(ShelfID id,
49 ShelfItemDelegate* item_delegate) override {}
48 50
49 private: 51 private:
50 void AddToResult(const std::string& format, int count, std::string* result) { 52 void AddToResult(const std::string& format, int count, std::string* result) {
51 if (!count) 53 if (!count)
52 return; 54 return;
53 if (!result->empty()) 55 if (!result->empty())
54 *result += " "; 56 *result += " ";
55 *result += base::StringPrintf(format.c_str(), count); 57 *result += base::StringPrintf(format.c_str(), count);
56 } 58 }
57 59
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 // Now change the type of the second item and make sure that it is moving 341 // Now change the type of the second item and make sure that it is moving
340 // behind the shortcuts. 342 // behind the shortcuts.
341 item.type = TYPE_PLATFORM_APP; 343 item.type = TYPE_PLATFORM_APP;
342 model_->Set(app2_index, item); 344 model_->Set(app2_index, item);
343 345
344 // The item should have moved in front of the app launcher. 346 // The item should have moved in front of the app launcher.
345 EXPECT_EQ(TYPE_PLATFORM_APP, model_->items()[4].type); 347 EXPECT_EQ(TYPE_PLATFORM_APP, model_->items()[4].type);
346 } 348 }
347 349
348 } // namespace ash 350 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/shelf_model_observer.h ('k') | ash/common/wm_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698