| 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/ui/webui/chromeos/login/update_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/update_screen_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" |
| 7 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/values.h" | 10 #include "base/values.h" |
| 9 #include "grit/chromium_strings.h" | 11 #include "grit/chromium_strings.h" |
| 10 #include "grit/generated_resources.h" | 12 #include "grit/generated_resources.h" |
| 11 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
| 12 | 14 |
| 13 namespace { | 15 namespace { |
| 14 | 16 |
| 15 // Update screen ID. | 17 // Update screen ID. |
| 16 const char kUpdateScreen[] = "update"; | 18 const char kUpdateScreen[] = "update"; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 info_message.reset(Value::CreateStringValue( | 100 info_message.reset(Value::CreateStringValue( |
| 99 l10n_util::GetStringFUTF16(IDS_INSTALLING_UPDATE, | 101 l10n_util::GetStringFUTF16(IDS_INSTALLING_UPDATE, |
| 100 l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)))); | 102 l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)))); |
| 101 } | 103 } |
| 102 web_ui_->CallJavascriptFunction("cr.ui.Oobe.setUpdateMessage", | 104 web_ui_->CallJavascriptFunction("cr.ui.Oobe.setUpdateMessage", |
| 103 *info_message); | 105 *info_message); |
| 104 } | 106 } |
| 105 | 107 |
| 106 void UpdateScreenHandler::RegisterMessages() { | 108 void UpdateScreenHandler::RegisterMessages() { |
| 107 #if !defined(OFFICIAL_BUILD) | 109 #if !defined(OFFICIAL_BUILD) |
| 108 web_ui_->RegisterMessageCallback( | 110 web_ui_->RegisterMessageCallback("cancelUpdate", |
| 109 "cancelUpdate", | 111 base::Bind(&UpdateScreenHandler::HandleUpdateCancel, |
| 110 NewCallback(this, &UpdateScreenHandler::HandleUpdateCancel)); | 112 base::Unretained(this))); |
| 111 #endif | 113 #endif |
| 112 } | 114 } |
| 113 | 115 |
| 114 #if !defined(OFFICIAL_BUILD) | 116 #if !defined(OFFICIAL_BUILD) |
| 115 void UpdateScreenHandler::HandleUpdateCancel(const base::ListValue* args) { | 117 void UpdateScreenHandler::HandleUpdateCancel(const base::ListValue* args) { |
| 116 DCHECK(args && args->empty()); | 118 DCHECK(args && args->empty()); |
| 117 screen_->CancelUpdate(); | 119 screen_->CancelUpdate(); |
| 118 } | 120 } |
| 119 #endif | 121 #endif |
| 120 | 122 |
| 121 } // namespace chromeos | 123 } // namespace chromeos |
| OLD | NEW |