| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 component_updater::ComponentUpdateService* cus = | 148 component_updater::ComponentUpdateService* cus = |
| 149 g_browser_process->component_updater(); | 149 g_browser_process->component_updater(); |
| 150 if (cus) | 150 if (cus) |
| 151 cus->RemoveObserver(this); | 151 cus->RemoveObserver(this); |
| 152 } | 152 } |
| 153 | 153 |
| 154 // static | 154 // static |
| 155 void ComponentsUI::OnDemandUpdate(const std::string& component_id) { | 155 void ComponentsUI::OnDemandUpdate(const std::string& component_id) { |
| 156 component_updater::ComponentUpdateService* cus = | 156 component_updater::ComponentUpdateService* cus = |
| 157 g_browser_process->component_updater(); | 157 g_browser_process->component_updater(); |
| 158 cus->GetOnDemandUpdater().OnDemandUpdate(component_id); | 158 cus->OnDemandUpdate(component_id); |
| 159 } | 159 } |
| 160 | 160 |
| 161 // static | 161 // static |
| 162 base::ListValue* ComponentsUI::LoadComponents() { | 162 base::ListValue* ComponentsUI::LoadComponents() { |
| 163 component_updater::ComponentUpdateService* cus = | 163 component_updater::ComponentUpdateService* cus = |
| 164 g_browser_process->component_updater(); | 164 g_browser_process->component_updater(); |
| 165 std::vector<std::string> component_ids; | 165 std::vector<std::string> component_ids; |
| 166 component_ids = cus->GetComponentIDs(); | 166 component_ids = cus->GetComponentIDs(); |
| 167 | 167 |
| 168 // Construct DictionaryValues to return to UI. | 168 // Construct DictionaryValues to return to UI. |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 if (event == ComponentUpdateService::Observer::COMPONENT_UPDATED) { | 246 if (event == ComponentUpdateService::Observer::COMPONENT_UPDATED) { |
| 247 ComponentUpdateService* cus = g_browser_process->component_updater(); | 247 ComponentUpdateService* cus = g_browser_process->component_updater(); |
| 248 component_updater::CrxUpdateItem item; | 248 component_updater::CrxUpdateItem item; |
| 249 if (cus->GetComponentDetails(id, &item)) | 249 if (cus->GetComponentDetails(id, &item)) |
| 250 parameters.SetString("version", item.component.version.GetString()); | 250 parameters.SetString("version", item.component.version.GetString()); |
| 251 } | 251 } |
| 252 parameters.SetString("id", id); | 252 parameters.SetString("id", id); |
| 253 } | 253 } |
| 254 web_ui()->CallJavascriptFunction("onComponentEvent", parameters); | 254 web_ui()->CallJavascriptFunction("onComponentEvent", parameters); |
| 255 } | 255 } |
| OLD | NEW |