| Index: chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc
|
| diff --git a/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc b/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc
|
| index 876e5910982467bcca8f2bc5348d9afdeca5e2c4..411fd51ff79de1f75b95c1c4d1d568d151d980f2 100644
|
| --- a/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc
|
| +++ b/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc
|
| @@ -16,7 +16,9 @@
|
| #include "ash/wm_window.h"
|
| #include "base/bind.h"
|
| #include "base/memory/ptr_util.h"
|
| +#include "chrome/browser/chromeos/arc/arc_optin_uma.h"
|
| #include "chrome/browser/chromeos/arc/arc_util.h"
|
| +#include "chrome/browser/chromeos/arc/policy/arc_policy_util.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
|
| #include "chrome/browser/ui/ash/launcher/arc_app_window.h"
|
| @@ -150,6 +152,8 @@ ArcAppWindowLauncherController::ArcAppWindowLauncherController(
|
| if (arc::IsArcAllowedForProfile(owner->profile())) {
|
| observed_profile_ = owner->profile();
|
| StartObserving(observed_profile_);
|
| +
|
| + arc::ArcSessionManager::Get()->AddObserver(this);
|
| }
|
| }
|
|
|
| @@ -158,6 +162,8 @@ ArcAppWindowLauncherController::~ArcAppWindowLauncherController() {
|
| StopObserving(observed_profile_);
|
| if (observing_shell_)
|
| ash::Shell::Get()->RemoveShellObserver(this);
|
| + if (arc::ArcSessionManager::Get())
|
| + arc::ArcSessionManager::Get()->RemoveObserver(this);
|
| }
|
|
|
| void ArcAppWindowLauncherController::ActiveUserChanged(
|
| @@ -491,6 +497,16 @@ ArcAppWindowLauncherController::ControllerForWindow(aura::Window* window) {
|
| return nullptr;
|
| }
|
|
|
| +void ArcAppWindowLauncherController::OnArcOptInManagementCheckStarted() {
|
| + // In case of retry this time is updated and we measure only successful run.
|
| + opt_in_management_check_start_time_ = base::Time::Now();
|
| +}
|
| +
|
| +void ArcAppWindowLauncherController::OnArcSessionStopped(
|
| + arc::ArcStopReason stop_reason) {
|
| + opt_in_management_check_start_time_ = base::Time();
|
| +}
|
| +
|
| void ArcAppWindowLauncherController::OnWindowActivated(
|
| aura::client::ActivationChangeObserver::ActivationReason reason,
|
| aura::Window* gained_active,
|
| @@ -576,6 +592,14 @@ void ArcAppWindowLauncherController::RegisterApp(
|
| owner()->SetItemStatus(shelf_id, ash::STATUS_RUNNING);
|
| app_window->SetController(controller);
|
| app_window->set_shelf_id(shelf_id);
|
| +
|
| + if (!opt_in_management_check_start_time_.is_null() &&
|
| + app_window_info->app_shelf_id().app_id() == arc::kPlayStoreAppId) {
|
| + arc::UpdatePlayStoreShowTime(
|
| + base::Time::Now() - opt_in_management_check_start_time_,
|
| + arc::policy_util::IsAccountManaged(owner()->profile()));
|
| + opt_in_management_check_start_time_ = base::Time();
|
| + }
|
| }
|
|
|
| void ArcAppWindowLauncherController::UnregisterApp(
|
|
|