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 26 matching lines...) Expand all Loading... |
37 #include "grit/components_strings.h" | 37 #include "grit/components_strings.h" |
38 #include "ui/base/l10n/l10n_util.h" | 38 #include "ui/base/l10n/l10n_util.h" |
39 #include "ui/base/resource/resource_bundle.h" | 39 #include "ui/base/resource/resource_bundle.h" |
40 | 40 |
41 #if defined(OS_CHROMEOS) | 41 #if defined(OS_CHROMEOS) |
42 #include "base/sys_info.h" | 42 #include "base/sys_info.h" |
43 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" | 43 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" |
44 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_fact
ory.h" | 44 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_fact
ory.h" |
45 #include "chrome/browser/chromeos/settings/cros_settings.h" | 45 #include "chrome/browser/chromeos/settings/cros_settings.h" |
46 #include "chrome/browser/chromeos/settings/owner_flags_storage.h" | 46 #include "chrome/browser/chromeos/settings/owner_flags_storage.h" |
| 47 #include "chromeos/cryptohome/cryptohome_parameters.h" |
47 #include "chromeos/dbus/dbus_thread_manager.h" | 48 #include "chromeos/dbus/dbus_thread_manager.h" |
48 #include "chromeos/dbus/session_manager_client.h" | 49 #include "chromeos/dbus/session_manager_client.h" |
49 #include "components/pref_registry/pref_registry_syncable.h" | 50 #include "components/pref_registry/pref_registry_syncable.h" |
50 #include "components/user_manager/user_manager.h" | 51 #include "components/user_manager/user_manager.h" |
51 #endif | 52 #endif |
52 | 53 |
53 using content::WebContents; | 54 using content::WebContents; |
54 using content::WebUIMessageHandler; | 55 using content::WebUIMessageHandler; |
55 | 56 |
56 namespace { | 57 namespace { |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 about_flags::ConvertFlagsToSwitches(flags_storage_.get(), | 240 about_flags::ConvertFlagsToSwitches(flags_storage_.get(), |
240 &user_flags, | 241 &user_flags, |
241 flags_ui::kAddSentinels); | 242 flags_ui::kAddSentinels); |
242 base::CommandLine::StringVector flags; | 243 base::CommandLine::StringVector flags; |
243 // argv[0] is the program name |base::CommandLine::NO_PROGRAM|. | 244 // argv[0] is the program name |base::CommandLine::NO_PROGRAM|. |
244 flags.assign(user_flags.argv().begin() + 1, user_flags.argv().end()); | 245 flags.assign(user_flags.argv().begin() + 1, user_flags.argv().end()); |
245 VLOG(1) << "Restarting to apply per-session flags..."; | 246 VLOG(1) << "Restarting to apply per-session flags..."; |
246 chromeos::DBusThreadManager::Get() | 247 chromeos::DBusThreadManager::Get() |
247 ->GetSessionManagerClient() | 248 ->GetSessionManagerClient() |
248 ->SetFlagsForUser( | 249 ->SetFlagsForUser( |
249 user_manager::UserManager::Get()->GetActiveUser()->email(), flags); | 250 cryptohome::Identification(user_manager::UserManager::Get() |
| 251 ->GetActiveUser() |
| 252 ->GetAccountId()), |
| 253 flags); |
250 #endif | 254 #endif |
251 chrome::AttemptRestart(); | 255 chrome::AttemptRestart(); |
252 } | 256 } |
253 | 257 |
254 void FlagsDOMHandler::HandleResetAllFlags(const base::ListValue* args) { | 258 void FlagsDOMHandler::HandleResetAllFlags(const base::ListValue* args) { |
255 DCHECK(flags_storage_); | 259 DCHECK(flags_storage_); |
256 about_flags::ResetAllFlags(flags_storage_.get()); | 260 about_flags::ResetAllFlags(flags_storage_.get()); |
257 } | 261 } |
258 | 262 |
259 | 263 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 334 |
331 FlagsUI::~FlagsUI() { | 335 FlagsUI::~FlagsUI() { |
332 } | 336 } |
333 | 337 |
334 // static | 338 // static |
335 base::RefCountedMemory* FlagsUI::GetFaviconResourceBytes( | 339 base::RefCountedMemory* FlagsUI::GetFaviconResourceBytes( |
336 ui::ScaleFactor scale_factor) { | 340 ui::ScaleFactor scale_factor) { |
337 return ResourceBundle::GetSharedInstance(). | 341 return ResourceBundle::GetSharedInstance(). |
338 LoadDataResourceBytesForScale(IDR_FLAGS_FAVICON, scale_factor); | 342 LoadDataResourceBytesForScale(IDR_FLAGS_FAVICON, scale_factor); |
339 } | 343 } |
OLD | NEW |