OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/chromeos/cros/login_library.h" | 5 #include "chrome/browser/chromeos/cros/login_library.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/chromeos/cros/cros_library.h" | 9 #include "chrome/browser/chromeos/cros/cros_library.h" |
10 #include "chrome/browser/chromeos/login/signed_settings_temp_storage.h" | 10 #include "chrome/browser/chromeos/login/signed_settings_temp_storage.h" |
11 #include "chrome/browser/prefs/pref_service.h" | |
11 #include "content/browser/browser_thread.h" | 12 #include "content/browser/browser_thread.h" |
12 #include "content/common/notification_service.h" | 13 #include "content/common/notification_service.h" |
13 #include "content/common/notification_type.h" | 14 #include "content/common/notification_type.h" |
14 | 15 |
15 namespace chromeos { | 16 namespace chromeos { |
16 | 17 |
17 class LoginLibraryImpl : public LoginLibrary { | 18 class LoginLibraryImpl : public LoginLibrary { |
18 public: | 19 public: |
19 LoginLibraryImpl() | 20 LoginLibraryImpl() |
20 : set_owner_key_callback_(NULL), | 21 : set_owner_key_callback_(NULL), |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
123 bool StopSession(const std::string& unique_id /* unused */) { | 124 bool StopSession(const std::string& unique_id /* unused */) { |
124 // only pass unique_id through once we use it for something. | 125 // only pass unique_id through once we use it for something. |
125 return chromeos::StopSession(""); | 126 return chromeos::StopSession(""); |
126 } | 127 } |
127 | 128 |
128 bool RestartEntd() { | 129 bool RestartEntd() { |
129 return chromeos::RestartEntd(); | 130 return chromeos::RestartEntd(); |
130 } | 131 } |
131 | 132 |
132 bool RestartJob(int pid, const std::string& command_line) { | 133 bool RestartJob(int pid, const std::string& command_line) { |
134 if (g_browser_process && g_browser_process->local_state()) { | |
135 // XXX: normally this call must not be needed, however it turned out that | |
Nikita (slow)
2011/03/17 16:04:40
Please comment in this one too
http://code.google.
| |
136 // without this explicit call to SavePersistentPrefs it is possible for | |
137 // preferences to be lost. See http://crosbug.com/13102 | |
138 g_browser_process->local_state()->SavePersistentPrefs(); | |
139 } | |
133 return chromeos::RestartJob(pid, command_line.c_str()); | 140 return chromeos::RestartJob(pid, command_line.c_str()); |
134 } | 141 } |
135 | 142 |
136 private: | 143 private: |
137 static void Handler(void* object, const OwnershipEvent& event) { | 144 static void Handler(void* object, const OwnershipEvent& event) { |
138 LoginLibraryImpl* self = static_cast<LoginLibraryImpl*>(object); | 145 LoginLibraryImpl* self = static_cast<LoginLibraryImpl*>(object); |
139 switch (event) { | 146 switch (event) { |
140 case SetKeySuccess: | 147 case SetKeySuccess: |
141 self->CompleteSetOwnerKey(true); | 148 self->CompleteSetOwnerKey(true); |
142 break; | 149 break; |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
271 | 278 |
272 // static | 279 // static |
273 LoginLibrary* LoginLibrary::GetImpl(bool stub) { | 280 LoginLibrary* LoginLibrary::GetImpl(bool stub) { |
274 if (stub) | 281 if (stub) |
275 return new LoginLibraryStubImpl(); | 282 return new LoginLibraryStubImpl(); |
276 else | 283 else |
277 return new LoginLibraryImpl(); | 284 return new LoginLibraryImpl(); |
278 } | 285 } |
279 | 286 |
280 } // namespace chromeos | 287 } // namespace chromeos |
OLD | NEW |