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

Side by Side Diff: ash/shelf/shelf_view_unittest.cc

Issue 2771663002: mash: Refactor ChromeLauncherController's ShelfDelegate code. (Closed)
Patch Set: Address comments. Created 3 years, 9 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 (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/common/shelf/shelf_view.h" 5 #include "ash/common/shelf/shelf_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 256
257 void set_is_app_pinned(bool is_pinned) { is_app_pinned_ = is_pinned; } 257 void set_is_app_pinned(bool is_pinned) { is_app_pinned_ = is_pinned; }
258 258
259 // ShelfDelegate overrides: 259 // ShelfDelegate overrides:
260 ShelfID GetShelfIDForAppID(const std::string& app_id) override { 260 ShelfID GetShelfIDForAppID(const std::string& app_id) override {
261 unsigned id = kInvalidShelfID; 261 unsigned id = kInvalidShelfID;
262 EXPECT_TRUE(base::StringToUint(app_id, &id)); 262 EXPECT_TRUE(base::StringToUint(app_id, &id));
263 return base::checked_cast<ShelfID>(id); 263 return base::checked_cast<ShelfID>(id);
264 } 264 }
265 265
266 bool HasShelfIDToAppIDMapping(ShelfID id) const override { return true; }
267
268 const std::string& GetAppIDForShelfID(ShelfID id) override { 266 const std::string& GetAppIDForShelfID(ShelfID id) override {
269 // Use |app_id_| member variable because returning a reference to local 267 // Use |app_id_| member variable because returning a reference to local
270 // variable is not allowed. 268 // variable is not allowed.
271 app_id_ = base::IntToString(id); 269 app_id_ = base::IntToString(id);
272 return app_id_; 270 return app_id_;
273 } 271 }
274 272
275 void PinAppWithID(const std::string& app_id) override { NOTREACHED(); } 273 void PinAppWithID(const std::string& app_id) override { NOTREACHED(); }
276 274
277 bool IsAppPinned(const std::string& app_id) override { 275 bool IsAppPinned(const std::string& app_id) override {
(...skipping 2750 matching lines...) Expand 10 before | Expand all | Expand 10 after
3028 EXPECT_EQ(views::InkDropState::ACTIVATED, 3026 EXPECT_EQ(views::InkDropState::ACTIVATED,
3029 overflow_button_ink_drop_->GetTargetInkDropState()); 3027 overflow_button_ink_drop_->GetTargetInkDropState());
3030 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), 3028 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(),
3031 IsEmpty()); 3029 IsEmpty());
3032 3030
3033 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); 3031 ASSERT_TRUE(test_api_->IsShowingOverflowBubble());
3034 } 3032 }
3035 3033
3036 } // namespace test 3034 } // namespace test
3037 } // namespace ash 3035 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/shelf_delegate_mus.cc ('k') | chrome/browser/ui/ash/launcher/chrome_launcher_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698