| 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/flags_ui.h" | 5 #include "chrome/browser/ui/webui/flags_ui.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "content/public/browser/web_ui.h" | 27 #include "content/public/browser/web_ui.h" |
| 28 #include "content/public/browser/web_ui_data_source.h" | 28 #include "content/public/browser/web_ui_data_source.h" |
| 29 #include "content/public/browser/web_ui_message_handler.h" | 29 #include "content/public/browser/web_ui_message_handler.h" |
| 30 #include "grit/browser_resources.h" | 30 #include "grit/browser_resources.h" |
| 31 #include "grit/theme_resources.h" | 31 #include "grit/theme_resources.h" |
| 32 #include "ui/base/l10n/l10n_util.h" | 32 #include "ui/base/l10n/l10n_util.h" |
| 33 #include "ui/base/resource/resource_bundle.h" | 33 #include "ui/base/resource/resource_bundle.h" |
| 34 | 34 |
| 35 #if defined(OS_CHROMEOS) | 35 #if defined(OS_CHROMEOS) |
| 36 #include "base/sys_info.h" | 36 #include "base/sys_info.h" |
| 37 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" | 37 #include "chrome/browser/chromeos/ownership/owner_settings_service.h" |
| 38 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_fact
ory.h" | 38 #include "chrome/browser/chromeos/ownership/owner_settings_service_factory.h" |
| 39 #include "chrome/browser/chromeos/settings/cros_settings.h" | 39 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 40 #include "chrome/browser/chromeos/settings/owner_flags_storage.h" | 40 #include "chrome/browser/chromeos/settings/owner_flags_storage.h" |
| 41 #include "chromeos/dbus/dbus_thread_manager.h" | 41 #include "chromeos/dbus/dbus_thread_manager.h" |
| 42 #include "chromeos/dbus/session_manager_client.h" | 42 #include "chromeos/dbus/session_manager_client.h" |
| 43 #include "components/pref_registry/pref_registry_syncable.h" | 43 #include "components/pref_registry/pref_registry_syncable.h" |
| 44 #include "components/user_manager/user_manager.h" | 44 #include "components/user_manager/user_manager.h" |
| 45 #endif | 45 #endif |
| 46 | 46 |
| 47 using content::WebContents; | 47 using content::WebContents; |
| 48 using content::WebUIMessageHandler; | 48 using content::WebUIMessageHandler; |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 | 285 |
| 286 FlagsUI::FlagsUI(content::WebUI* web_ui) | 286 FlagsUI::FlagsUI(content::WebUI* web_ui) |
| 287 : WebUIController(web_ui), | 287 : WebUIController(web_ui), |
| 288 weak_factory_(this) { | 288 weak_factory_(this) { |
| 289 Profile* profile = Profile::FromWebUI(web_ui); | 289 Profile* profile = Profile::FromWebUI(web_ui); |
| 290 | 290 |
| 291 FlagsDOMHandler* handler = new FlagsDOMHandler(); | 291 FlagsDOMHandler* handler = new FlagsDOMHandler(); |
| 292 web_ui->AddMessageHandler(handler); | 292 web_ui->AddMessageHandler(handler); |
| 293 | 293 |
| 294 #if defined(OS_CHROMEOS) | 294 #if defined(OS_CHROMEOS) |
| 295 chromeos::OwnerSettingsServiceChromeOS* service = | 295 chromeos::OwnerSettingsService* service = |
| 296 chromeos::OwnerSettingsServiceChromeOSFactory::GetForProfile(profile); | 296 chromeos::OwnerSettingsServiceFactory::GetForProfile(profile); |
| 297 if (service) { | 297 if (service) { |
| 298 service->IsOwnerAsync(base::Bind( | 298 service->IsOwnerAsync(base::Bind( |
| 299 &FinishInitialization, weak_factory_.GetWeakPtr(), profile, handler)); | 299 &FinishInitialization, weak_factory_.GetWeakPtr(), profile, handler)); |
| 300 } else { | 300 } else { |
| 301 FinishInitialization(weak_factory_.GetWeakPtr(), | 301 FinishInitialization(weak_factory_.GetWeakPtr(), |
| 302 profile, | 302 profile, |
| 303 handler, | 303 handler, |
| 304 false /* current_user_is_owner */); | 304 false /* current_user_is_owner */); |
| 305 } | 305 } |
| 306 #else | 306 #else |
| (...skipping 22 matching lines...) Expand all Loading... |
| 329 } | 329 } |
| 330 | 330 |
| 331 #if defined(OS_CHROMEOS) | 331 #if defined(OS_CHROMEOS) |
| 332 // static | 332 // static |
| 333 void FlagsUI::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 333 void FlagsUI::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
| 334 registry->RegisterListPref(prefs::kEnabledLabsExperiments, | 334 registry->RegisterListPref(prefs::kEnabledLabsExperiments, |
| 335 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 335 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 336 } | 336 } |
| 337 | 337 |
| 338 #endif | 338 #endif |
| OLD | NEW |