| 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" |
| 11 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" | 11 #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" | 12 #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" | 13 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" |
| 14 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 14 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| 15 | 15 |
| 16 ArcAppDeferredLauncherItemController::ArcAppDeferredLauncherItemController( | 16 ArcAppDeferredLauncherItemController::ArcAppDeferredLauncherItemController( |
| 17 const std::string& arc_app_id, | 17 const std::string& arc_app_id, |
| 18 ChromeLauncherController* controller, | |
| 19 int event_flags, | 18 int event_flags, |
| 20 const base::WeakPtr<ArcAppDeferredLauncherController>& host) | 19 const base::WeakPtr<ArcAppDeferredLauncherController>& host) |
| 21 : LauncherItemController(ash::AppLaunchId(arc_app_id), controller), | 20 : ash::ShelfItemDelegate(ash::AppLaunchId(arc_app_id)), |
| 22 event_flags_(event_flags), | 21 event_flags_(event_flags), |
| 23 host_(host), | 22 host_(host), |
| 24 start_time_(base::Time::Now()) {} | 23 start_time_(base::Time::Now()) {} |
| 25 | 24 |
| 26 ArcAppDeferredLauncherItemController::~ArcAppDeferredLauncherItemController() { | 25 ArcAppDeferredLauncherItemController::~ArcAppDeferredLauncherItemController() { |
| 27 if (host_) | 26 if (host_) |
| 28 host_->Remove(app_id()); | 27 host_->Remove(app_id()); |
| 29 } | 28 } |
| 30 | 29 |
| 31 base::TimeDelta ArcAppDeferredLauncherItemController::GetActiveTime() const { | 30 base::TimeDelta ArcAppDeferredLauncherItemController::GetActiveTime() const { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 43 void ArcAppDeferredLauncherItemController::ExecuteCommand(uint32_t command_id, | 42 void ArcAppDeferredLauncherItemController::ExecuteCommand(uint32_t command_id, |
| 44 int32_t event_flags) { | 43 int32_t event_flags) { |
| 45 // This delegate does not support showing an application menu. | 44 // This delegate does not support showing an application menu. |
| 46 NOTIMPLEMENTED(); | 45 NOTIMPLEMENTED(); |
| 47 } | 46 } |
| 48 | 47 |
| 49 void ArcAppDeferredLauncherItemController::Close() { | 48 void ArcAppDeferredLauncherItemController::Close() { |
| 50 if (host_) | 49 if (host_) |
| 51 host_->Close(app_id()); | 50 host_->Close(app_id()); |
| 52 } | 51 } |
| OLD | NEW |