| 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 1935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1946 | 1946 |
| 1947 void BrowserOptionsHandler::ShowAndroidAppsSettings( | 1947 void BrowserOptionsHandler::ShowAndroidAppsSettings( |
| 1948 const base::ListValue* args) { | 1948 const base::ListValue* args) { |
| 1949 Profile* profile = Profile::FromWebUI(web_ui()); | 1949 Profile* profile = Profile::FromWebUI(web_ui()); |
| 1950 // Settings in secondary profile cannot access ARC. | 1950 // Settings in secondary profile cannot access ARC. |
| 1951 if (!arc::ArcAuthService::IsAllowedForProfile(profile)) { | 1951 if (!arc::ArcAuthService::IsAllowedForProfile(profile)) { |
| 1952 LOG(ERROR) << "Settings can't be invoked for non-primary profile"; | 1952 LOG(ERROR) << "Settings can't be invoked for non-primary profile"; |
| 1953 return; | 1953 return; |
| 1954 } | 1954 } |
| 1955 | 1955 |
| 1956 arc::LaunchAndroidSettingsApp(profile); | 1956 // We only care whether the event came from a keyboard or non-keyboard |
| 1957 // (mouse/touch). Set the default flags in such a way that it would appear |
| 1958 // that it came from a mouse by default. |
| 1959 bool activated_from_keyboard = false; |
| 1960 args->GetBoolean(0, &activated_from_keyboard); |
| 1961 int flags = activated_from_keyboard ? ui::EF_NONE : ui::EF_LEFT_MOUSE_BUTTON; |
| 1962 |
| 1963 arc::LaunchAndroidSettingsApp(profile, flags); |
| 1957 } | 1964 } |
| 1958 | 1965 |
| 1959 void BrowserOptionsHandler::ShowAccessibilityTalkBackSettings( | 1966 void BrowserOptionsHandler::ShowAccessibilityTalkBackSettings( |
| 1960 const base::ListValue *args) { | 1967 const base::ListValue *args) { |
| 1961 Profile* profile = Profile::FromWebUI(web_ui()); | 1968 Profile* profile = Profile::FromWebUI(web_ui()); |
| 1962 // Settings in secondary profile cannot access ARC. | 1969 // Settings in secondary profile cannot access ARC. |
| 1963 if (!arc::ArcAuthService::IsAllowedForProfile(profile)) { | 1970 if (!arc::ArcAuthService::IsAllowedForProfile(profile)) { |
| 1964 LOG(WARNING) << "Settings can't be invoked for non-primary profile"; | 1971 LOG(WARNING) << "Settings can't be invoked for non-primary profile"; |
| 1965 return; | 1972 return; |
| 1966 } | 1973 } |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2234 | 2241 |
| 2235 bool BrowserOptionsHandler::IsDeviceOwnerProfile() { | 2242 bool BrowserOptionsHandler::IsDeviceOwnerProfile() { |
| 2236 #if defined(OS_CHROMEOS) | 2243 #if defined(OS_CHROMEOS) |
| 2237 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui())); | 2244 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui())); |
| 2238 #else | 2245 #else |
| 2239 return true; | 2246 return true; |
| 2240 #endif | 2247 #endif |
| 2241 } | 2248 } |
| 2242 | 2249 |
| 2243 } // namespace options | 2250 } // namespace options |
| OLD | NEW |