| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/components_ui.h" | 5 #include "chrome/browser/ui/webui/components_ui.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h" | 29 #include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h" |
| 30 #endif | 30 #endif |
| 31 | 31 |
| 32 using content::WebUIMessageHandler; | 32 using content::WebUIMessageHandler; |
| 33 | 33 |
| 34 namespace { | 34 namespace { |
| 35 | 35 |
| 36 content::WebUIDataSource* CreateComponentsUIHTMLSource(Profile* profile) { | 36 content::WebUIDataSource* CreateComponentsUIHTMLSource(Profile* profile) { |
| 37 content::WebUIDataSource* source = | 37 content::WebUIDataSource* source = |
| 38 content::WebUIDataSource::Create(chrome::kChromeUIComponentsHost); | 38 content::WebUIDataSource::Create(chrome::kChromeUIComponentsHost); |
| 39 source->SetUseJsonJSFormatV2(); | |
| 40 | 39 |
| 41 source->AddLocalizedString("componentsTitle", IDS_COMPONENTS_TITLE); | 40 source->AddLocalizedString("componentsTitle", IDS_COMPONENTS_TITLE); |
| 42 source->AddLocalizedString("componentsNoneInstalled", | 41 source->AddLocalizedString("componentsNoneInstalled", |
| 43 IDS_COMPONENTS_NONE_INSTALLED); | 42 IDS_COMPONENTS_NONE_INSTALLED); |
| 44 source->AddLocalizedString("componentVersion", IDS_COMPONENTS_VERSION); | 43 source->AddLocalizedString("componentVersion", IDS_COMPONENTS_VERSION); |
| 45 source->AddLocalizedString("checkUpdate", IDS_COMPONENTS_CHECK_FOR_UPDATE); | 44 source->AddLocalizedString("checkUpdate", IDS_COMPONENTS_CHECK_FOR_UPDATE); |
| 46 source->AddLocalizedString("noComponents", IDS_COMPONENTS_NO_COMPONENTS); | 45 source->AddLocalizedString("noComponents", IDS_COMPONENTS_NO_COMPONENTS); |
| 47 source->AddLocalizedString("statusLabel", IDS_COMPONENTS_STATUS_LABEL); | 46 source->AddLocalizedString("statusLabel", IDS_COMPONENTS_STATUS_LABEL); |
| 48 source->AddLocalizedString("checkingLabel", IDS_COMPONENTS_CHECKING_LABEL); | 47 source->AddLocalizedString("checkingLabel", IDS_COMPONENTS_CHECKING_LABEL); |
| 49 | 48 |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 if (event == ComponentUpdateService::Observer::COMPONENT_UPDATED) { | 245 if (event == ComponentUpdateService::Observer::COMPONENT_UPDATED) { |
| 247 ComponentUpdateService* cus = g_browser_process->component_updater(); | 246 ComponentUpdateService* cus = g_browser_process->component_updater(); |
| 248 component_updater::CrxUpdateItem item; | 247 component_updater::CrxUpdateItem item; |
| 249 if (cus->GetComponentDetails(id, &item)) | 248 if (cus->GetComponentDetails(id, &item)) |
| 250 parameters.SetString("version", item.component.version.GetString()); | 249 parameters.SetString("version", item.component.version.GetString()); |
| 251 } | 250 } |
| 252 parameters.SetString("id", id); | 251 parameters.SetString("id", id); |
| 253 } | 252 } |
| 254 web_ui()->CallJavascriptFunction("onComponentEvent", parameters); | 253 web_ui()->CallJavascriptFunction("onComponentEvent", parameters); |
| 255 } | 254 } |
| OLD | NEW |