OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/options/browser_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/browser_options_handler.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 1990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2001 | 2001 |
2002 void BrowserOptionsHandler::ShowAndroidAppsSettings( | 2002 void BrowserOptionsHandler::ShowAndroidAppsSettings( |
2003 const base::ListValue* args) { | 2003 const base::ListValue* args) { |
2004 Profile* profile = Profile::FromWebUI(web_ui()); | 2004 Profile* profile = Profile::FromWebUI(web_ui()); |
2005 // Settings in secondary profile cannot access ARC. | 2005 // Settings in secondary profile cannot access ARC. |
2006 if (!arc::ArcSessionManager::IsAllowedForProfile(profile)) { | 2006 if (!arc::ArcSessionManager::IsAllowedForProfile(profile)) { |
2007 LOG(ERROR) << "Settings can't be invoked for non-primary profile"; | 2007 LOG(ERROR) << "Settings can't be invoked for non-primary profile"; |
2008 return; | 2008 return; |
2009 } | 2009 } |
2010 | 2010 |
2011 arc::LaunchAndroidSettingsApp(profile); | 2011 // We only care whether the event came from a keyboard or non-keyboard |
| 2012 // (mouse/touch). Set the default flags in such a way that it would appear |
| 2013 // that it came from a mouse by default. |
| 2014 bool activated_from_keyboard = false; |
| 2015 args->GetBoolean(0, &activated_from_keyboard); |
| 2016 int flags = activated_from_keyboard ? ui::EF_NONE : ui::EF_LEFT_MOUSE_BUTTON; |
| 2017 |
| 2018 arc::LaunchAndroidSettingsApp(profile, flags); |
2012 } | 2019 } |
2013 | 2020 |
2014 void BrowserOptionsHandler::ShowAccessibilityTalkBackSettings( | 2021 void BrowserOptionsHandler::ShowAccessibilityTalkBackSettings( |
2015 const base::ListValue *args) { | 2022 const base::ListValue *args) { |
2016 Profile* profile = Profile::FromWebUI(web_ui()); | 2023 Profile* profile = Profile::FromWebUI(web_ui()); |
2017 // Settings in secondary profile cannot access ARC. | 2024 // Settings in secondary profile cannot access ARC. |
2018 if (!arc::ArcSessionManager::IsAllowedForProfile(profile)) { | 2025 if (!arc::ArcSessionManager::IsAllowedForProfile(profile)) { |
2019 LOG(WARNING) << "Settings can't be invoked for non-primary profile"; | 2026 LOG(WARNING) << "Settings can't be invoked for non-primary profile"; |
2020 return; | 2027 return; |
2021 } | 2028 } |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2290 | 2297 |
2291 bool BrowserOptionsHandler::IsDeviceOwnerProfile() { | 2298 bool BrowserOptionsHandler::IsDeviceOwnerProfile() { |
2292 #if defined(OS_CHROMEOS) | 2299 #if defined(OS_CHROMEOS) |
2293 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui())); | 2300 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui())); |
2294 #else | 2301 #else |
2295 return true; | 2302 return true; |
2296 #endif | 2303 #endif |
2297 } | 2304 } |
2298 | 2305 |
2299 } // namespace options | 2306 } // namespace options |
OLD | NEW |