OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/ui/ash/launcher/launcher_context_menu.h" | 5 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "ash/common/shelf/shelf_model.h" | 9 #include "ash/common/shelf/shelf_model.h" |
10 #include "ash/common/shelf/wm_shelf.h" | 10 #include "ash/common/shelf/wm_shelf.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 } | 109 } |
110 } | 110 } |
111 | 111 |
112 void LauncherContextMenu::ExecuteCommand(int command_id, int event_flags) { | 112 void LauncherContextMenu::ExecuteCommand(int command_id, int event_flags) { |
113 switch (static_cast<MenuItem>(command_id)) { | 113 switch (static_cast<MenuItem>(command_id)) { |
114 case MENU_OPEN_NEW: | 114 case MENU_OPEN_NEW: |
115 controller_->Launch(item_.id, ui::EF_NONE); | 115 controller_->Launch(item_.id, ui::EF_NONE); |
116 break; | 116 break; |
117 case MENU_CLOSE: | 117 case MENU_CLOSE: |
118 if (item_.type == ash::TYPE_DIALOG) { | 118 if (item_.type == ash::TYPE_DIALOG) { |
119 ash::ShelfItemDelegate* item_delegate = | 119 ash::mojom::ShelfItemDelegate* item_delegate = |
120 ash::WmShell::Get()->shelf_model()->GetShelfItemDelegate(item_.id); | 120 ash::WmShell::Get()->shelf_model()->GetShelfItemDelegate(item_.id); |
121 DCHECK(item_delegate); | 121 DCHECK(item_delegate); |
122 item_delegate->Close(); | 122 item_delegate->Close(); |
123 } else { | 123 } else { |
124 // TODO(simonhong): Use ShelfItemDelegate::Close(). | 124 // TODO(simonhong): Use ShelfItemDelegate::Close(). |
125 controller_->Close(item_.id); | 125 controller_->Close(item_.id); |
126 } | 126 } |
127 ash::WmShell::Get()->RecordUserMetricsAction( | 127 ash::WmShell::Get()->RecordUserMetricsAction( |
128 ash::UMA_CLOSE_THROUGH_CONTEXT_MENU); | 128 ash::UMA_CLOSE_THROUGH_CONTEXT_MENU); |
129 break; | 129 break; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 case MENU_PIN: | 199 case MENU_PIN: |
200 case MENU_AUTO_HIDE: | 200 case MENU_AUTO_HIDE: |
201 case MENU_ALIGNMENT_MENU: | 201 case MENU_ALIGNMENT_MENU: |
202 case MENU_CHANGE_WALLPAPER: | 202 case MENU_CHANGE_WALLPAPER: |
203 LauncherContextMenu::ExecuteCommand(command_id, event_flags); | 203 LauncherContextMenu::ExecuteCommand(command_id, event_flags); |
204 return true; | 204 return true; |
205 default: | 205 default: |
206 return false; | 206 return false; |
207 } | 207 } |
208 } | 208 } |
OLD | NEW |