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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 #include <utility> | 12 #include <utility> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/values.h" | 16 #include "base/values.h" |
17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
19 #include "chrome/browser/ui/browser.h" | |
20 #include "chrome/browser/ui/browser_window.h" | 19 #include "chrome/browser/ui/browser_window.h" |
21 #include "chrome/common/chrome_paths.h" | 20 #include "chrome/common/chrome_paths.h" |
22 #include "chrome/common/url_constants.h" | 21 #include "chrome/common/url_constants.h" |
23 #include "chrome/grit/generated_resources.h" | 22 #include "chrome/grit/generated_resources.h" |
24 #include "components/component_updater/component_updater_service.h" | 23 #include "components/component_updater/component_updater_service.h" |
25 #include "content/public/browser/web_ui.h" | 24 #include "content/public/browser/web_ui.h" |
26 #include "content/public/browser/web_ui_data_source.h" | 25 #include "content/public/browser/web_ui_data_source.h" |
27 #include "content/public/browser/web_ui_message_handler.h" | 26 #include "content/public/browser/web_ui_message_handler.h" |
28 #include "grit/browser_resources.h" | 27 #include "grit/browser_resources.h" |
29 #include "grit/theme_resources.h" | 28 #include "grit/theme_resources.h" |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 if (event == Events::COMPONENT_UPDATED) { | 255 if (event == Events::COMPONENT_UPDATED) { |
257 auto* component_updater = g_browser_process->component_updater(); | 256 auto* component_updater = g_browser_process->component_updater(); |
258 update_client::CrxUpdateItem item; | 257 update_client::CrxUpdateItem item; |
259 if (component_updater->GetComponentDetails(id, &item)) | 258 if (component_updater->GetComponentDetails(id, &item)) |
260 parameters.SetString("version", item.component.version.GetString()); | 259 parameters.SetString("version", item.component.version.GetString()); |
261 } | 260 } |
262 parameters.SetString("id", id); | 261 parameters.SetString("id", id); |
263 } | 262 } |
264 web_ui()->CallJavascriptFunctionUnsafe("onComponentEvent", parameters); | 263 web_ui()->CallJavascriptFunctionUnsafe("onComponentEvent", parameters); |
265 } | 264 } |
OLD | NEW |