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

Side by Side Diff: chrome/browser/ui/webui/chromeos/network_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
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/chromeos/network_ui.h" 5 #include "chrome/browser/ui/webui/chromeos/network_ui.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 std::unique_ptr<base::DictionaryValue> dictionary_copy( 105 std::unique_ptr<base::DictionaryValue> dictionary_copy(
106 dictionary.DeepCopy()); 106 dictionary.DeepCopy());
107 107
108 // Set the 'ServicePath' property for debugging. 108 // Set the 'ServicePath' property for debugging.
109 dictionary_copy->SetStringWithoutPathExpansion("ServicePath", service_path); 109 dictionary_copy->SetStringWithoutPathExpansion("ServicePath", service_path);
110 // Set the device properties for debugging. 110 // Set the device properties for debugging.
111 SetDeviceProperties(dictionary_copy.get()); 111 SetDeviceProperties(dictionary_copy.get());
112 112
113 base::ListValue return_arg_list; 113 base::ListValue return_arg_list;
114 return_arg_list.Append(dictionary_copy.release()); 114 return_arg_list.Append(dictionary_copy.release());
115 web_ui()->CallJavascriptFunction("NetworkUI.getShillPropertiesResult", 115 web_ui()->CallJavascriptFunctionUnsafe("NetworkUI.getShillPropertiesResult",
116 return_arg_list); 116 return_arg_list);
117 } 117 }
118 118
119 void ErrorCallback( 119 void ErrorCallback(
120 const std::string& guid, 120 const std::string& guid,
121 const std::string& error_name, 121 const std::string& error_name,
122 std::unique_ptr<base::DictionaryValue> /* error_data */) const { 122 std::unique_ptr<base::DictionaryValue> /* error_data */) const {
123 NET_LOG(ERROR) << "Shill Error: " << error_name << " guid=" << guid; 123 NET_LOG(ERROR) << "Shill Error: " << error_name << " guid=" << guid;
124 base::ListValue return_arg_list; 124 base::ListValue return_arg_list;
125 std::unique_ptr<base::DictionaryValue> dictionary; 125 std::unique_ptr<base::DictionaryValue> dictionary;
126 dictionary->SetStringWithoutPathExpansion(shill::kGuidProperty, guid); 126 dictionary->SetStringWithoutPathExpansion(shill::kGuidProperty, guid);
127 dictionary->SetStringWithoutPathExpansion("ShillError", error_name); 127 dictionary->SetStringWithoutPathExpansion("ShillError", error_name);
128 return_arg_list.Append(dictionary.release()); 128 return_arg_list.Append(dictionary.release());
129 web_ui()->CallJavascriptFunction("NetworkUI.getShillPropertiesResult", 129 web_ui()->CallJavascriptFunctionUnsafe("NetworkUI.getShillPropertiesResult",
130 return_arg_list); 130 return_arg_list);
131 } 131 }
132 132
133 base::WeakPtrFactory<NetworkConfigMessageHandler> weak_ptr_factory_; 133 base::WeakPtrFactory<NetworkConfigMessageHandler> weak_ptr_factory_;
134 134
135 DISALLOW_COPY_AND_ASSIGN(NetworkConfigMessageHandler); 135 DISALLOW_COPY_AND_ASSIGN(NetworkConfigMessageHandler);
136 }; 136 };
137 137
138 } // namespace 138 } // namespace
139 139
140 NetworkUI::NetworkUI(content::WebUI* web_ui) 140 NetworkUI::NetworkUI(content::WebUI* web_ui)
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 html->SetDefaultResource(IDR_NETWORK_UI_HTML); 189 html->SetDefaultResource(IDR_NETWORK_UI_HTML);
190 190
191 content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(), 191 content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(),
192 html); 192 html);
193 } 193 }
194 194
195 NetworkUI::~NetworkUI() { 195 NetworkUI::~NetworkUI() {
196 } 196 }
197 197
198 } // namespace chromeos 198 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc ('k') | chrome/browser/ui/webui/chromeos/nfc_debug_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698