Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: chrome/browser/ui/webui/components_ui.cc

Issue 1995113002: Rename WebUI::CallJavascriptFunction to WebUI::CallJavascriptFunctionUnsafe (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/webui/chromeos/slow_ui.cc ('k') | chrome/browser/ui/webui/conflicts_ui.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <string> 10 #include <string>
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 "checkUpdate", 98 "checkUpdate",
99 base::Bind(&ComponentsDOMHandler::HandleCheckUpdate, 99 base::Bind(&ComponentsDOMHandler::HandleCheckUpdate,
100 base::Unretained(this))); 100 base::Unretained(this)));
101 } 101 }
102 102
103 void ComponentsDOMHandler::HandleRequestComponentsData( 103 void ComponentsDOMHandler::HandleRequestComponentsData(
104 const base::ListValue* args) { 104 const base::ListValue* args) {
105 base::ListValue* list = ComponentsUI::LoadComponents(); 105 base::ListValue* list = ComponentsUI::LoadComponents();
106 base::DictionaryValue result; 106 base::DictionaryValue result;
107 result.Set("components", list); 107 result.Set("components", list);
108 web_ui()->CallJavascriptFunction("returnComponentsData", result); 108 web_ui()->CallJavascriptFunctionUnsafe("returnComponentsData", result);
109 } 109 }
110 110
111 // This function is called when user presses button from html UI. 111 // This function is called when user presses button from html UI.
112 // TODO(shrikant): We need to make this button available based on current 112 // TODO(shrikant): We need to make this button available based on current
113 // state e.g. If component state is currently updating then we need to disable 113 // state e.g. If component state is currently updating then we need to disable
114 // button. (https://code.google.com/p/chromium/issues/detail?id=272540) 114 // button. (https://code.google.com/p/chromium/issues/detail?id=272540)
115 void ComponentsDOMHandler::HandleCheckUpdate(const base::ListValue* args) { 115 void ComponentsDOMHandler::HandleCheckUpdate(const base::ListValue* args) {
116 if (args->GetSize() != 1) { 116 if (args->GetSize() != 1) {
117 NOTREACHED(); 117 NOTREACHED();
118 return; 118 return;
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 parameters.SetString("event", ComponentEventToString(event)); 249 parameters.SetString("event", ComponentEventToString(event));
250 if (!id.empty()) { 250 if (!id.empty()) {
251 if (event == Events::COMPONENT_UPDATED) { 251 if (event == Events::COMPONENT_UPDATED) {
252 auto cus = g_browser_process->component_updater(); 252 auto cus = g_browser_process->component_updater();
253 update_client::CrxUpdateItem item; 253 update_client::CrxUpdateItem item;
254 if (cus->GetComponentDetails(id, &item)) 254 if (cus->GetComponentDetails(id, &item))
255 parameters.SetString("version", item.component.version.GetString()); 255 parameters.SetString("version", item.component.version.GetString());
256 } 256 }
257 parameters.SetString("id", id); 257 parameters.SetString("id", id);
258 } 258 }
259 web_ui()->CallJavascriptFunction("onComponentEvent", parameters); 259 web_ui()->CallJavascriptFunctionUnsafe("onComponentEvent", parameters);
260 } 260 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/slow_ui.cc ('k') | chrome/browser/ui/webui/conflicts_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698