| 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 #include <utility> |
| 8 | 9 |
| 9 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" | 12 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" |
| 12 #include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.h" | 13 #include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.h" |
| 13 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" | 14 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" |
| 14 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 15 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| 15 | 16 |
| 16 ArcAppDeferredLauncherItemController::ArcAppDeferredLauncherItemController( | 17 ArcAppDeferredLauncherItemController::ArcAppDeferredLauncherItemController( |
| 17 const std::string& arc_app_id, | 18 const std::string& arc_app_id, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 28 } | 29 } |
| 29 | 30 |
| 30 base::TimeDelta ArcAppDeferredLauncherItemController::GetActiveTime() const { | 31 base::TimeDelta ArcAppDeferredLauncherItemController::GetActiveTime() const { |
| 31 return base::Time::Now() - start_time_; | 32 return base::Time::Now() - start_time_; |
| 32 } | 33 } |
| 33 | 34 |
| 34 void ArcAppDeferredLauncherItemController::ItemSelected( | 35 void ArcAppDeferredLauncherItemController::ItemSelected( |
| 35 std::unique_ptr<ui::Event> event, | 36 std::unique_ptr<ui::Event> event, |
| 36 int64_t display_id, | 37 int64_t display_id, |
| 37 ash::ShelfLaunchSource source, | 38 ash::ShelfLaunchSource source, |
| 38 const ItemSelectedCallback& callback) { | 39 ItemSelectedCallback callback) { |
| 39 callback.Run(ash::SHELF_ACTION_NONE, base::nullopt); | 40 std::move(callback).Run(ash::SHELF_ACTION_NONE, base::nullopt); |
| 40 } | 41 } |
| 41 | 42 |
| 42 void ArcAppDeferredLauncherItemController::ExecuteCommand(uint32_t command_id, | 43 void ArcAppDeferredLauncherItemController::ExecuteCommand(uint32_t command_id, |
| 43 int32_t event_flags) { | 44 int32_t event_flags) { |
| 44 // This delegate does not support showing an application menu. | 45 // This delegate does not support showing an application menu. |
| 45 NOTIMPLEMENTED(); | 46 NOTIMPLEMENTED(); |
| 46 } | 47 } |
| 47 | 48 |
| 48 void ArcAppDeferredLauncherItemController::Close() { | 49 void ArcAppDeferredLauncherItemController::Close() { |
| 49 if (host_) | 50 if (host_) |
| 50 host_->Close(app_id()); | 51 host_->Close(app_id()); |
| 51 } | 52 } |
| OLD | NEW |