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

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

Issue 2696073002: Merge ShelfItemDelegate::ItemSelected & LauncherItemDelegate::Activate. (Closed)
Patch Set: Cleanup Created 3 years, 10 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/common/shelf/shelf_controller.h" 5 #include "ash/common/shelf/shelf_controller.h"
6 6
7 #include "ash/common/shelf/shelf_item_delegate.h" 7 #include "ash/common/shelf/shelf_item_delegate.h"
8 #include "ash/common/shelf/wm_shelf.h" 8 #include "ash/common/shelf/wm_shelf.h"
9 #include "ash/common/wm_lookup.h" 9 #include "ash/common/wm_lookup.h"
10 #include "ash/common/wm_shell.h" 10 #include "ash/common/wm_shell.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } 47 }
48 const std::map<uint32_t, base::string16>& window_id_to_title() const { 48 const std::map<uint32_t, base::string16>& window_id_to_title() const {
49 return window_id_to_title_; 49 return window_id_to_title_;
50 } 50 }
51 51
52 const base::string16& title() { return title_; } 52 const base::string16& title() { return title_; }
53 void set_title(const base::string16& title) { title_ = title; } 53 void set_title(const base::string16& title) { title_ = title; }
54 54
55 private: 55 private:
56 // ShelfItemDelegate: 56 // ShelfItemDelegate:
57 ShelfItemDelegate::PerformedAction ItemSelected( 57 ShelfAction ItemSelected(ui::EventType event_type,
58 const ui::Event& event) override { 58 int event_flags,
59 int64_t display_id,
60 ShelfLaunchSource source) override {
59 if (window_id_to_title_.empty()) { 61 if (window_id_to_title_.empty()) {
60 delegate_->LaunchItem(); 62 delegate_->LaunchItem();
61 return kNewWindowCreated; 63 return kNewWindowCreated;
62 } 64 }
63 if (window_id_to_title_.size() == 1) { 65 if (window_id_to_title_.size() == 1) {
64 // TODO(mash): Activate the window and return kExistingWindowActivated. 66 // TODO(mash): Activate the window and return kExistingWindowActivated.
65 NOTIMPLEMENTED(); 67 NOTIMPLEMENTED();
66 } 68 }
67 return kNoAction; 69 return kNoAction;
68 } 70 }
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 return; 233 return;
232 ShelfID shelf_id = app_id_to_shelf_id_[app_id]; 234 ShelfID shelf_id = app_id_to_shelf_id_[app_id];
233 int index = model_.ItemIndexByID(shelf_id); 235 int index = model_.ItemIndexByID(shelf_id);
234 DCHECK_GE(index, 0); 236 DCHECK_GE(index, 0);
235 ShelfItem item = *model_.ItemByID(shelf_id); 237 ShelfItem item = *model_.ItemByID(shelf_id);
236 item.image = GetShelfIconFromBitmap(image); 238 item.image = GetShelfIconFromBitmap(image);
237 model_.Set(index, item); 239 model_.Set(index, item);
238 } 240 }
239 241
240 } // namespace ash 242 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698