Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Side by Side Diff: chrome/browser/ui/webui/options/browser_options_handler.cc

Issue 2540433002: Reland "Propagate information about how ARC apps are launched" (Closed)
Patch Set: Rebase to ToT Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 int flags = ui::EF_LEFT_MOUSE_BUTTON;
stevenjb 2016/11/29 20:17:10 Again, since what we really care about is whether
Luis Héctor Chávez 2016/11/29 20:50:46 Done.
2015 bool is_mouse_or_touch = true;
2016 if (args->GetBoolean(0, &is_mouse_or_touch) && !is_mouse_or_touch)
2017 flags = ui::EF_NONE;
stevenjb 2016/11/29 20:17:10 nit: int flags = is_mouse_or_touch ? ui::EF_LEFT_
Luis Héctor Chávez 2016/11/29 20:50:46 Done.
2018
2019 arc::LaunchAndroidSettingsApp(profile, flags);
2012 } 2020 }
2013 2021
2014 void BrowserOptionsHandler::ShowAccessibilityTalkBackSettings( 2022 void BrowserOptionsHandler::ShowAccessibilityTalkBackSettings(
2015 const base::ListValue *args) { 2023 const base::ListValue *args) {
2016 Profile* profile = Profile::FromWebUI(web_ui()); 2024 Profile* profile = Profile::FromWebUI(web_ui());
2017 // Settings in secondary profile cannot access ARC. 2025 // Settings in secondary profile cannot access ARC.
2018 if (!arc::ArcSessionManager::IsAllowedForProfile(profile)) { 2026 if (!arc::ArcSessionManager::IsAllowedForProfile(profile)) {
2019 LOG(WARNING) << "Settings can't be invoked for non-primary profile"; 2027 LOG(WARNING) << "Settings can't be invoked for non-primary profile";
2020 return; 2028 return;
2021 } 2029 }
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
2290 2298
2291 bool BrowserOptionsHandler::IsDeviceOwnerProfile() { 2299 bool BrowserOptionsHandler::IsDeviceOwnerProfile() {
2292 #if defined(OS_CHROMEOS) 2300 #if defined(OS_CHROMEOS)
2293 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui())); 2301 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui()));
2294 #else 2302 #else
2295 return true; 2303 return true;
2296 #endif 2304 #endif
2297 } 2305 }
2298 2306
2299 } // namespace options 2307 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698