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

Side by Side Diff: ash/test/test_shelf_delegate.cc

Issue 2290603002: Enhance chrome.app.window API for shelf integration with pinning support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: LauncherItemController Unit Tests Fix after Rebase Created 4 years, 3 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 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/common/shelf/shelf_model.h" 9 #include "ash/common/shelf/shelf_model.h"
10 #include "ash/shelf/shelf_util.h" 10 #include "ash/shelf/shelf_util.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 void TestShelfDelegate::OnShelfVisibilityStateChanged(WmShelf* shelf) {} 98 void TestShelfDelegate::OnShelfVisibilityStateChanged(WmShelf* shelf) {}
99 99
100 ShelfID TestShelfDelegate::GetShelfIDForAppID(const std::string& app_id) { 100 ShelfID TestShelfDelegate::GetShelfIDForAppID(const std::string& app_id) {
101 for (auto const& iter : shelf_id_to_app_id_map_) { 101 for (auto const& iter : shelf_id_to_app_id_map_) {
102 if (iter.second == app_id) 102 if (iter.second == app_id)
103 return iter.first; 103 return iter.first;
104 } 104 }
105 return 0; 105 return 0;
106 } 106 }
107 107
108 ShelfID TestShelfDelegate::GetShelfIDForAppIDAndLaunchID(
109 const std::string& app_id,
110 const std::string& launch_id) {
111 return GetShelfIDForAppID(app_id);
112 }
113
108 bool TestShelfDelegate::HasShelfIDToAppIDMapping(ShelfID id) const { 114 bool TestShelfDelegate::HasShelfIDToAppIDMapping(ShelfID id) const {
109 return shelf_id_to_app_id_map_.find(id) != shelf_id_to_app_id_map_.end(); 115 return shelf_id_to_app_id_map_.find(id) != shelf_id_to_app_id_map_.end();
110 } 116 }
111 117
112 const std::string& TestShelfDelegate::GetAppIDForShelfID(ShelfID id) { 118 const std::string& TestShelfDelegate::GetAppIDForShelfID(ShelfID id) {
113 DCHECK_GT(shelf_id_to_app_id_map_.count(id), 0u); 119 DCHECK_GT(shelf_id_to_app_id_map_.count(id), 0u);
114 return shelf_id_to_app_id_map_[id]; 120 return shelf_id_to_app_id_map_[id];
115 } 121 }
116 122
117 void TestShelfDelegate::PinAppWithID(const std::string& app_id) { 123 void TestShelfDelegate::PinAppWithID(const std::string& app_id) {
(...skipping 12 matching lines...) Expand all
130 const std::string& app_id) { 136 const std::string& app_id) {
131 shelf_id_to_app_id_map_[shelf_id] = app_id; 137 shelf_id_to_app_id_map_[shelf_id] = app_id;
132 } 138 }
133 139
134 void TestShelfDelegate::RemoveShelfIDToAppIDMapping(ShelfID shelf_id) { 140 void TestShelfDelegate::RemoveShelfIDToAppIDMapping(ShelfID shelf_id) {
135 shelf_id_to_app_id_map_.erase(shelf_id); 141 shelf_id_to_app_id_map_.erase(shelf_id);
136 } 142 }
137 143
138 } // namespace test 144 } // namespace test
139 } // namespace ash 145 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/test_shelf_delegate.h ('k') | chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698