OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/options/chromeos/date_time_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/date_time_options_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/chromeos/set_time_dialog.h" | 10 #include "chrome/browser/chromeos/set_time_dialog.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // Callback for set time button. | 53 // Callback for set time button. |
54 web_ui()->RegisterMessageCallback( | 54 web_ui()->RegisterMessageCallback( |
55 "showSetTime", | 55 "showSetTime", |
56 base::Bind(&DateTimeOptionsHandler::HandleShowSetTime, | 56 base::Bind(&DateTimeOptionsHandler::HandleShowSetTime, |
57 base::Unretained(this))); | 57 base::Unretained(this))); |
58 } | 58 } |
59 | 59 |
60 void DateTimeOptionsHandler::SystemClockCanSetTimeChanged(bool can_set_time) { | 60 void DateTimeOptionsHandler::SystemClockCanSetTimeChanged(bool can_set_time) { |
61 if (page_initialized_) { | 61 if (page_initialized_) { |
62 web_ui()->CallJavascriptFunctionUnsafe( | 62 web_ui()->CallJavascriptFunctionUnsafe( |
63 "BrowserOptions.setCanSetTime", base::FundamentalValue(can_set_time)); | 63 "BrowserOptions.setCanSetTime", base::Value(can_set_time)); |
64 } | 64 } |
65 can_set_time_ = can_set_time; | 65 can_set_time_ = can_set_time; |
66 } | 66 } |
67 | 67 |
68 void DateTimeOptionsHandler::HandleShowSetTime(const base::ListValue* args) { | 68 void DateTimeOptionsHandler::HandleShowSetTime(const base::ListValue* args) { |
69 // Make sure the clock status hasn't changed since the button was clicked. | 69 // Make sure the clock status hasn't changed since the button was clicked. |
70 if (can_set_time_) { | 70 if (can_set_time_) { |
71 SetTimeDialog::ShowDialogInParent( | 71 SetTimeDialog::ShowDialogInParent( |
72 web_ui()->GetWebContents()->GetTopLevelNativeWindow()); | 72 web_ui()->GetWebContents()->GetTopLevelNativeWindow()); |
73 } | 73 } |
74 } | 74 } |
75 | 75 |
76 } // namespace options | 76 } // namespace options |
77 } // namespace chromeos | 77 } // namespace chromeos |
OLD | NEW |