| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/md_settings_ui.h" | 5 #include "chrome/browser/ui/webui/settings/md_settings_ui.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "chrome/grit/settings_resources.h" | 39 #include "chrome/grit/settings_resources.h" |
| 40 #include "chrome/grit/settings_resources_map.h" | 40 #include "chrome/grit/settings_resources_map.h" |
| 41 #include "content/public/browser/navigation_handle.h" | 41 #include "content/public/browser/navigation_handle.h" |
| 42 #include "content/public/browser/web_contents.h" | 42 #include "content/public/browser/web_contents.h" |
| 43 #include "content/public/browser/web_ui.h" | 43 #include "content/public/browser/web_ui.h" |
| 44 #include "content/public/browser/web_ui_data_source.h" | 44 #include "content/public/browser/web_ui_data_source.h" |
| 45 | 45 |
| 46 #if defined(OS_CHROMEOS) | 46 #if defined(OS_CHROMEOS) |
| 47 #include "ash/common/system/chromeos/palette/palette_utils.h" | 47 #include "ash/common/system/chromeos/palette/palette_utils.h" |
| 48 #include "ash/common/system/chromeos/power/power_status.h" | 48 #include "ash/common/system/chromeos/power/power_status.h" |
| 49 #include "chrome/browser/chromeos/arc/arc_session_manager.h" | 49 #include "chrome/browser/chromeos/arc/arc_util.h" |
| 50 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h" | 50 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h" |
| 51 #include "chrome/browser/ui/ash/ash_util.h" | 51 #include "chrome/browser/ui/ash/ash_util.h" |
| 52 #include "chrome/browser/ui/webui/settings/chromeos/accessibility_handler.h" | 52 #include "chrome/browser/ui/webui/settings/chromeos/accessibility_handler.h" |
| 53 #include "chrome/browser/ui/webui/settings/chromeos/android_apps_handler.h" | 53 #include "chrome/browser/ui/webui/settings/chromeos/android_apps_handler.h" |
| 54 #include "chrome/browser/ui/webui/settings/chromeos/change_picture_handler.h" | 54 #include "chrome/browser/ui/webui/settings/chromeos/change_picture_handler.h" |
| 55 #include "chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.h" | 55 #include "chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.h" |
| 56 #include "chrome/browser/ui/webui/settings/chromeos/date_time_handler.h" | 56 #include "chrome/browser/ui/webui/settings/chromeos/date_time_handler.h" |
| 57 #include "chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler.h" | 57 #include "chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler.h" |
| 58 #include "chrome/browser/ui/webui/settings/chromeos/device_pointer_handler.h" | 58 #include "chrome/browser/ui/webui/settings/chromeos/device_pointer_handler.h" |
| 59 #include "chrome/browser/ui/webui/settings/chromeos/device_power_handler.h" | 59 #include "chrome/browser/ui/webui/settings/chromeos/device_power_handler.h" |
| 60 #include "chrome/browser/ui/webui/settings/chromeos/device_storage_handler.h" | 60 #include "chrome/browser/ui/webui/settings/chromeos/device_storage_handler.h" |
| 61 #include "chrome/browser/ui/webui/settings/chromeos/easy_unlock_settings_handler
.h" | 61 #include "chrome/browser/ui/webui/settings/chromeos/easy_unlock_settings_handler
.h" |
| 62 #include "chrome/browser/ui/webui/settings/chromeos/internet_handler.h" | 62 #include "chrome/browser/ui/webui/settings/chromeos/internet_handler.h" |
| 63 #include "chrome/common/chrome_switches.h" | 63 #include "chrome/common/chrome_switches.h" |
| 64 #include "components/arc/arc_util.h" |
| 64 #else // !defined(OS_CHROMEOS) | 65 #else // !defined(OS_CHROMEOS) |
| 65 #include "chrome/browser/ui/webui/settings/settings_default_browser_handler.h" | 66 #include "chrome/browser/ui/webui/settings/settings_default_browser_handler.h" |
| 66 #include "chrome/browser/ui/webui/settings/settings_manage_profile_handler.h" | 67 #include "chrome/browser/ui/webui/settings/settings_manage_profile_handler.h" |
| 67 #include "chrome/browser/ui/webui/settings/system_handler.h" | 68 #include "chrome/browser/ui/webui/settings/system_handler.h" |
| 68 #endif // defined(OS_CHROMEOS) | 69 #endif // defined(OS_CHROMEOS) |
| 69 | 70 |
| 70 #if defined(USE_NSS_CERTS) | 71 #if defined(USE_NSS_CERTS) |
| 71 #include "chrome/browser/ui/webui/settings/certificates_handler.h" | 72 #include "chrome/browser/ui/webui/settings/certificates_handler.h" |
| 72 #elif defined(OS_WIN) || defined(OS_MACOSX) | 73 #elif defined(OS_WIN) || defined(OS_MACOSX) |
| 73 #include "chrome/browser/ui/webui/settings/native_certificates_handler.h" | 74 #include "chrome/browser/ui/webui/settings/native_certificates_handler.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 profile); | 148 profile); |
| 148 if (easy_unlock_handler) | 149 if (easy_unlock_handler) |
| 149 AddSettingsPageUIHandler(base::WrapUnique(easy_unlock_handler)); | 150 AddSettingsPageUIHandler(base::WrapUnique(easy_unlock_handler)); |
| 150 | 151 |
| 151 AddSettingsPageUIHandler(base::WrapUnique( | 152 AddSettingsPageUIHandler(base::WrapUnique( |
| 152 chromeos::settings::DateTimeHandler::Create(html_source))); | 153 chromeos::settings::DateTimeHandler::Create(html_source))); |
| 153 | 154 |
| 154 html_source->AddBoolean("stylusAllowed", ash::IsPaletteFeatureEnabled()); | 155 html_source->AddBoolean("stylusAllowed", ash::IsPaletteFeatureEnabled()); |
| 155 html_source->AddBoolean("pinUnlockEnabled", | 156 html_source->AddBoolean("pinUnlockEnabled", |
| 156 chromeos::IsPinUnlockEnabled(profile->GetPrefs())); | 157 chromeos::IsPinUnlockEnabled(profile->GetPrefs())); |
| 157 html_source->AddBoolean( | 158 html_source->AddBoolean("androidAppsAllowed", |
| 158 "androidAppsAllowed", | 159 arc::IsArcAllowedForProfile(profile) && |
| 159 arc::ArcSessionManager::IsAllowedForProfile(profile) && | 160 !arc::IsArcOptInVerificationDisabled()); |
| 160 !arc::ArcSessionManager::IsOptInVerificationDisabled()); | |
| 161 | 161 |
| 162 // TODO(mash): Support Chrome power settings in Mash. crbug.com/644348 | 162 // TODO(mash): Support Chrome power settings in Mash. crbug.com/644348 |
| 163 bool enable_power_settings = | 163 bool enable_power_settings = |
| 164 !chrome::IsRunningInMash() && | 164 !chrome::IsRunningInMash() && |
| 165 (switches::PowerOverlayEnabled() || | 165 (switches::PowerOverlayEnabled() || |
| 166 (ash::PowerStatus::Get()->IsBatteryPresent() && | 166 (ash::PowerStatus::Get()->IsBatteryPresent() && |
| 167 ash::PowerStatus::Get()->SupportsDualRoleDevices())); | 167 ash::PowerStatus::Get()->SupportsDualRoleDevices())); |
| 168 html_source->AddBoolean("enablePowerSettings", enable_power_settings); | 168 html_source->AddBoolean("enablePowerSettings", enable_power_settings); |
| 169 if (enable_power_settings) { | 169 if (enable_power_settings) { |
| 170 AddSettingsPageUIHandler( | 170 AddSettingsPageUIHandler( |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 UMA_HISTOGRAM_TIMES("Settings.LoadDocumentTime.MD", | 216 UMA_HISTOGRAM_TIMES("Settings.LoadDocumentTime.MD", |
| 217 base::Time::Now() - load_start_time_); | 217 base::Time::Now() - load_start_time_); |
| 218 } | 218 } |
| 219 | 219 |
| 220 void MdSettingsUI::DocumentOnLoadCompletedInMainFrame() { | 220 void MdSettingsUI::DocumentOnLoadCompletedInMainFrame() { |
| 221 UMA_HISTOGRAM_TIMES("Settings.LoadCompletedTime.MD", | 221 UMA_HISTOGRAM_TIMES("Settings.LoadCompletedTime.MD", |
| 222 base::Time::Now() - load_start_time_); | 222 base::Time::Now() - load_start_time_); |
| 223 } | 223 } |
| 224 | 224 |
| 225 } // namespace settings | 225 } // namespace settings |
| OLD | NEW |