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

Unified Diff: ash/shelf/shelf_window_watcher_item_delegate.cc

Issue 2860503002: mash: Replace int ShelfIDs with AppLaunchID strings. (Closed)
Patch Set: Fix struct traits typo. Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shelf/shelf_window_watcher_item_delegate.h ('k') | ash/shelf/shelf_window_watcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_window_watcher_item_delegate.cc
diff --git a/ash/shelf/shelf_window_watcher_item_delegate.cc b/ash/shelf/shelf_window_watcher_item_delegate.cc
index 63108346fe2cd6e3b6b92dcf90a1052d353dce9a..43398d85350bf4e86c152ca78679c449b19cb878 100644
--- a/ash/shelf/shelf_window_watcher_item_delegate.cc
+++ b/ash/shelf/shelf_window_watcher_item_delegate.cc
@@ -18,7 +18,7 @@ namespace ash {
namespace {
-ShelfItemType GetShelfItemType(ShelfID id) {
+ShelfItemType GetShelfItemType(const ShelfID& id) {
ShelfModel* model = Shell::Get()->shelf_controller()->model();
ShelfItems::const_iterator item = model->ItemByID(id);
return item == model->items().end() ? TYPE_UNDEFINED : item->type;
@@ -26,10 +26,11 @@ ShelfItemType GetShelfItemType(ShelfID id) {
} // namespace
-ShelfWindowWatcherItemDelegate::ShelfWindowWatcherItemDelegate(ShelfID id,
- WmWindow* window)
- : ShelfItemDelegate(AppLaunchId()), id_(id), window_(window) {
- DCHECK_NE(kInvalidShelfID, id_);
+ShelfWindowWatcherItemDelegate::ShelfWindowWatcherItemDelegate(
+ const ShelfID& id,
+ WmWindow* window)
+ : ShelfItemDelegate(id), window_(window) {
+ DCHECK(!id.IsNull());
DCHECK(window_);
}
@@ -41,7 +42,7 @@ void ShelfWindowWatcherItemDelegate::ItemSelected(
ShelfLaunchSource source,
const ItemSelectedCallback& callback) {
// Move panels attached on another display to the current display.
- if (GetShelfItemType(id_) == TYPE_APP_PANEL &&
+ if (GetShelfItemType(shelf_id()) == TYPE_APP_PANEL &&
window_->aura_window()->GetProperty(kPanelAttachedKey) &&
wm::MoveWindowToDisplay(window_->aura_window(), display_id)) {
window_->Activate();
« no previous file with comments | « ash/shelf/shelf_window_watcher_item_delegate.h ('k') | ash/shelf/shelf_window_watcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698