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

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

Issue 2540713003: Revert of Propagate information about how ARC apps are launched (Closed)
Patch Set: 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
« no previous file with comments | « chrome/browser/ui/ash/launcher/launcher_controller_helper.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // We only care whether the event came from a keyboard or non-keyboard 2011 arc::LaunchAndroidSettingsApp(profile);
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);
2019 } 2012 }
2020 2013
2021 void BrowserOptionsHandler::ShowAccessibilityTalkBackSettings( 2014 void BrowserOptionsHandler::ShowAccessibilityTalkBackSettings(
2022 const base::ListValue *args) { 2015 const base::ListValue *args) {
2023 Profile* profile = Profile::FromWebUI(web_ui()); 2016 Profile* profile = Profile::FromWebUI(web_ui());
2024 // Settings in secondary profile cannot access ARC. 2017 // Settings in secondary profile cannot access ARC.
2025 if (!arc::ArcSessionManager::IsAllowedForProfile(profile)) { 2018 if (!arc::ArcSessionManager::IsAllowedForProfile(profile)) {
2026 LOG(WARNING) << "Settings can't be invoked for non-primary profile"; 2019 LOG(WARNING) << "Settings can't be invoked for non-primary profile";
2027 return; 2020 return;
2028 } 2021 }
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
2297 2290
2298 bool BrowserOptionsHandler::IsDeviceOwnerProfile() { 2291 bool BrowserOptionsHandler::IsDeviceOwnerProfile() {
2299 #if defined(OS_CHROMEOS) 2292 #if defined(OS_CHROMEOS)
2300 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui())); 2293 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui()));
2301 #else 2294 #else
2302 return true; 2295 return true;
2303 #endif 2296 #endif
2304 } 2297 }
2305 2298
2306 } // namespace options 2299 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/launcher/launcher_controller_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698