| OLD | NEW | 
|    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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   64     } |   64     } | 
|   65     if (window_id_to_title_.size() == 1) { |   65     if (window_id_to_title_.size() == 1) { | 
|   66       // TODO(mash): Activate the window and return |   66       // TODO(mash): Activate the window and return | 
|   67       // SHELF_ACTION_WINDOW_ACTIVATED. |   67       // SHELF_ACTION_WINDOW_ACTIVATED. | 
|   68       NOTIMPLEMENTED(); |   68       NOTIMPLEMENTED(); | 
|   69     } |   69     } | 
|   70     return SHELF_ACTION_NONE; |   70     return SHELF_ACTION_NONE; | 
|   71   } |   71   } | 
|   72  |   72  | 
|   73   ShelfAppMenuItemList GetAppMenuItems(int event_flags) override { |   73   ShelfAppMenuItemList GetAppMenuItems(int event_flags) override { | 
|   74     ShelfAppMenuItemList items; |   74     // Return an empty item list to avoid showing an application menu. | 
|   75     for (const auto& window : window_id_to_title_) { |   75     return ShelfAppMenuItemList(); | 
|   76       items.push_back( |   76   } | 
|   77           base::MakeUnique<ShelfApplicationMenuItem>(window.second)); |   77  | 
|   78     } |   78   void ExecuteCommand(uint32_t command_id, int event_flags) override { | 
|   79     return items; |   79     // This delegate does not support showing an application menu. | 
 |   80     NOTIMPLEMENTED(); | 
|   80   } |   81   } | 
|   81  |   82  | 
|   82   void Close() override { NOTIMPLEMENTED(); } |   83   void Close() override { NOTIMPLEMENTED(); } | 
|   83  |   84  | 
|   84   mojom::ShelfItemDelegateAssociatedPtr delegate_; |   85   mojom::ShelfItemDelegateAssociatedPtr delegate_; | 
|   85   bool pinned_ = false; |   86   bool pinned_ = false; | 
|   86   std::map<uint32_t, base::string16> window_id_to_title_; |   87   std::map<uint32_t, base::string16> window_id_to_title_; | 
|   87   base::string16 title_; |   88   base::string16 title_; | 
|   88  |   89  | 
|   89   DISALLOW_COPY_AND_ASSIGN(ShelfItemDelegateMus); |   90   DISALLOW_COPY_AND_ASSIGN(ShelfItemDelegateMus); | 
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  234     return; |  235     return; | 
|  235   ShelfID shelf_id = app_id_to_shelf_id_[app_id]; |  236   ShelfID shelf_id = app_id_to_shelf_id_[app_id]; | 
|  236   int index = model_.ItemIndexByID(shelf_id); |  237   int index = model_.ItemIndexByID(shelf_id); | 
|  237   DCHECK_GE(index, 0); |  238   DCHECK_GE(index, 0); | 
|  238   ShelfItem item = *model_.ItemByID(shelf_id); |  239   ShelfItem item = *model_.ItemByID(shelf_id); | 
|  239   item.image = GetShelfIconFromBitmap(image); |  240   item.image = GetShelfIconFromBitmap(image); | 
|  240   model_.Set(index, item); |  241   model_.Set(index, item); | 
|  241 } |  242 } | 
|  242  |  243  | 
|  243 }  // namespace ash |  244 }  // namespace ash | 
| OLD | NEW |