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/chromeos/settings/system_settings_provider.h" | 5 #include "chrome/browser/chromeos/settings/system_settings_provider.h" |
6 | 6 |
7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chromeos/login/login_state.h" | 10 #include "chromeos/login/login_state.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 system::TimezoneSettings::GetInstance()->RemoveObserver(this); | 30 system::TimezoneSettings::GetInstance()->RemoveObserver(this); |
31 } | 31 } |
32 | 32 |
33 void SystemSettingsProvider::DoSet(const std::string& path, | 33 void SystemSettingsProvider::DoSet(const std::string& path, |
34 const base::Value& in_value) { | 34 const base::Value& in_value) { |
35 // Non-guest users can change the time zone. | 35 // Non-guest users can change the time zone. |
36 if (!LoginState::Get()->IsUserAuthenticated()) | 36 if (!LoginState::Get()->IsUserAuthenticated()) |
37 return; | 37 return; |
38 | 38 |
39 if (path == kSystemTimezone) { | 39 if (path == kSystemTimezone) { |
40 string16 timezone_id; | 40 base::string16 timezone_id; |
41 if (!in_value.GetAsString(&timezone_id)) | 41 if (!in_value.GetAsString(&timezone_id)) |
42 return; | 42 return; |
43 // This will call TimezoneChanged. | 43 // This will call TimezoneChanged. |
44 system::TimezoneSettings::GetInstance()->SetTimezoneFromID(timezone_id); | 44 system::TimezoneSettings::GetInstance()->SetTimezoneFromID(timezone_id); |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 const base::Value* SystemSettingsProvider::Get(const std::string& path) const { | 48 const base::Value* SystemSettingsProvider::Get(const std::string& path) const { |
49 if (path == kSystemTimezone) | 49 if (path == kSystemTimezone) |
50 return timezone_value_.get(); | 50 return timezone_value_.get(); |
(...skipping 21 matching lines...) Expand all Loading... |
72 content::RenderWidgetHost::GetRenderWidgetHosts()); | 72 content::RenderWidgetHost::GetRenderWidgetHosts()); |
73 while (content::RenderWidgetHost* widget = widgets->GetNextHost()) { | 73 while (content::RenderWidgetHost* widget = widgets->GetNextHost()) { |
74 if (widget->IsRenderView()) { | 74 if (widget->IsRenderView()) { |
75 content::RenderViewHost* view = content::RenderViewHost::From(widget); | 75 content::RenderViewHost* view = content::RenderViewHost::From(widget); |
76 view->NotifyTimezoneChange(); | 76 view->NotifyTimezoneChange(); |
77 } | 77 } |
78 } | 78 } |
79 } | 79 } |
80 | 80 |
81 } // namespace chromeos | 81 } // namespace chromeos |
OLD | NEW |