| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // | 61 // |
| 62 //////////////////////////////////////////////////////////////////////////////// | 62 //////////////////////////////////////////////////////////////////////////////// |
| 63 | 63 |
| 64 // The handler for Javascript messages for the chrome://components/ page. | 64 // The handler for Javascript messages for the chrome://components/ page. |
| 65 class ComponentsDOMHandler : public WebUIMessageHandler { | 65 class ComponentsDOMHandler : public WebUIMessageHandler { |
| 66 public: | 66 public: |
| 67 ComponentsDOMHandler(); | 67 ComponentsDOMHandler(); |
| 68 virtual ~ComponentsDOMHandler() {} | 68 virtual ~ComponentsDOMHandler() {} |
| 69 | 69 |
| 70 // WebUIMessageHandler implementation. | 70 // WebUIMessageHandler implementation. |
| 71 virtual void RegisterMessages() OVERRIDE; | 71 virtual void RegisterMessages() override; |
| 72 | 72 |
| 73 // Callback for the "requestComponentsData" message. | 73 // Callback for the "requestComponentsData" message. |
| 74 void HandleRequestComponentsData(const base::ListValue* args); | 74 void HandleRequestComponentsData(const base::ListValue* args); |
| 75 | 75 |
| 76 // Callback for the "checkUpdate" message. | 76 // Callback for the "checkUpdate" message. |
| 77 void HandleCheckUpdate(const base::ListValue* args); | 77 void HandleCheckUpdate(const base::ListValue* args); |
| 78 | 78 |
| 79 private: | 79 private: |
| 80 content::NotificationRegistrar registrar_; | 80 content::NotificationRegistrar registrar_; |
| 81 | 81 |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 if (event == ComponentUpdateService::Observer::COMPONENT_UPDATED) { | 245 if (event == ComponentUpdateService::Observer::COMPONENT_UPDATED) { |
| 246 ComponentUpdateService* cus = g_browser_process->component_updater(); | 246 ComponentUpdateService* cus = g_browser_process->component_updater(); |
| 247 component_updater::CrxUpdateItem item; | 247 component_updater::CrxUpdateItem item; |
| 248 if (cus->GetComponentDetails(id, &item)) | 248 if (cus->GetComponentDetails(id, &item)) |
| 249 parameters.SetString("version", item.component.version.GetString()); | 249 parameters.SetString("version", item.component.version.GetString()); |
| 250 } | 250 } |
| 251 parameters.SetString("id", id); | 251 parameters.SetString("id", id); |
| 252 } | 252 } |
| 253 web_ui()->CallJavascriptFunction("onComponentEvent", parameters); | 253 web_ui()->CallJavascriptFunction("onComponentEvent", parameters); |
| 254 } | 254 } |
| OLD | NEW |