| 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/webui/settings/chromeos/android_apps_handler.h" | 5 #include "chrome/browser/ui/webui/settings/chromeos/android_apps_handler.h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "chrome/browser/chromeos/arc/arc_session_manager.h" | 8 #include "chrome/browser/chromeos/arc/arc_session_manager.h" |
| 9 #include "chrome/browser/chromeos/arc/arc_util.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" // kSettingsAppId | 11 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" // kSettingsAppId |
| 11 #include "ui/events/event_constants.h" | 12 #include "ui/events/event_constants.h" |
| 12 | 13 |
| 13 namespace chromeos { | 14 namespace chromeos { |
| 14 namespace settings { | 15 namespace settings { |
| 15 | 16 |
| 16 AndroidAppsHandler::AndroidAppsHandler(Profile* profile) | 17 AndroidAppsHandler::AndroidAppsHandler(Profile* profile) |
| 17 : arc_prefs_observer_(this), profile_(profile), weak_ptr_factory_(this) {} | 18 : arc_prefs_observer_(this), profile_(profile), weak_ptr_factory_(this) {} |
| 18 | 19 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 base::StringValue("android-apps-info-update"), *info); | 86 base::StringValue("android-apps-info-update"), *info); |
| 86 } | 87 } |
| 87 | 88 |
| 88 void AndroidAppsHandler::ShowAndroidAppsSettings(const base::ListValue* args) { | 89 void AndroidAppsHandler::ShowAndroidAppsSettings(const base::ListValue* args) { |
| 89 CHECK_EQ(1U, args->GetSize()); | 90 CHECK_EQ(1U, args->GetSize()); |
| 90 bool activated_from_keyboard = false; | 91 bool activated_from_keyboard = false; |
| 91 args->GetBoolean(0, &activated_from_keyboard); | 92 args->GetBoolean(0, &activated_from_keyboard); |
| 92 int flags = activated_from_keyboard ? ui::EF_NONE : ui::EF_LEFT_MOUSE_BUTTON; | 93 int flags = activated_from_keyboard ? ui::EF_NONE : ui::EF_LEFT_MOUSE_BUTTON; |
| 93 | 94 |
| 94 // Settings in secondary profile cannot access ARC. | 95 // Settings in secondary profile cannot access ARC. |
| 95 CHECK(arc::ArcSessionManager::IsAllowedForProfile(profile_)); | 96 CHECK(arc::IsArcAllowedForProfile(profile_)); |
| 96 arc::LaunchAndroidSettingsApp(profile_, flags); | 97 arc::LaunchAndroidSettingsApp(profile_, flags); |
| 97 } | 98 } |
| 98 | 99 |
| 99 } // namespace settings | 100 } // namespace settings |
| 100 } // namespace chromeos | 101 } // namespace chromeos |
| OLD | NEW |