| 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 "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_item_controll
er.h" | 5 #include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_item_controll
er.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 ArcAppDeferredLauncherItemController::~ArcAppDeferredLauncherItemController() { | 26 ArcAppDeferredLauncherItemController::~ArcAppDeferredLauncherItemController() { |
| 27 if (host_) | 27 if (host_) |
| 28 host_->Remove(app_id()); | 28 host_->Remove(app_id()); |
| 29 } | 29 } |
| 30 | 30 |
| 31 base::TimeDelta ArcAppDeferredLauncherItemController::GetActiveTime() const { | 31 base::TimeDelta ArcAppDeferredLauncherItemController::GetActiveTime() const { |
| 32 return base::Time::Now() - start_time_; | 32 return base::Time::Now() - start_time_; |
| 33 } | 33 } |
| 34 | 34 |
| 35 ash::ShelfAction ArcAppDeferredLauncherItemController::ItemSelected( | 35 void ArcAppDeferredLauncherItemController::ItemSelected( |
| 36 ui::EventType event_type, | 36 std::unique_ptr<ui::Event> event, |
| 37 int event_flags, | |
| 38 int64_t display_id, | 37 int64_t display_id, |
| 39 ash::ShelfLaunchSource source) { | 38 ash::ShelfLaunchSource source, |
| 40 return ash::SHELF_ACTION_NONE; | 39 const ItemSelectedCallback& callback) { |
| 41 } | 40 callback.Run(ash::SHELF_ACTION_NONE, MenuItemList()); |
| 42 | |
| 43 ash::ShelfAppMenuItemList ArcAppDeferredLauncherItemController::GetAppMenuItems( | |
| 44 int event_flags) { | |
| 45 // Return an empty item list to avoid showing an application menu. | |
| 46 return ash::ShelfAppMenuItemList(); | |
| 47 } | 41 } |
| 48 | 42 |
| 49 void ArcAppDeferredLauncherItemController::ExecuteCommand(uint32_t command_id, | 43 void ArcAppDeferredLauncherItemController::ExecuteCommand(uint32_t command_id, |
| 50 int event_flags) { | 44 int32_t event_flags) { |
| 51 // This delegate does not support showing an application menu. | 45 // This delegate does not support showing an application menu. |
| 52 NOTIMPLEMENTED(); | 46 NOTIMPLEMENTED(); |
| 53 } | 47 } |
| 54 | 48 |
| 55 void ArcAppDeferredLauncherItemController::Close() { | 49 void ArcAppDeferredLauncherItemController::Close() { |
| 56 if (host_) | 50 if (host_) |
| 57 host_->Close(app_id()); | 51 host_->Close(app_id()); |
| 58 } | 52 } |
| OLD | NEW |