OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/login/network_dropdown.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/network_dropdown.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 ash::network_icon::NetworkIconAnimation::GetInstance()->AddObserver(this); | 193 ash::network_icon::NetworkIconAnimation::GetInstance()->AddObserver(this); |
194 } else { | 194 } else { |
195 ash::network_icon::NetworkIconAnimation::GetInstance()->RemoveObserver( | 195 ash::network_icon::NetworkIconAnimation::GetInstance()->RemoveObserver( |
196 this); | 196 this); |
197 } | 197 } |
198 SkBitmap icon_bitmap = icon_image.GetRepresentation( | 198 SkBitmap icon_bitmap = icon_image.GetRepresentation( |
199 web_ui_->GetDeviceScaleFactor()).sk_bitmap(); | 199 web_ui_->GetDeviceScaleFactor()).sk_bitmap(); |
200 std::string icon_str; | 200 std::string icon_str; |
201 if (!icon_image.isNull()) | 201 if (!icon_image.isNull()) |
202 icon_str = webui::GetBitmapDataUrl(icon_bitmap); | 202 icon_str = webui::GetBitmapDataUrl(icon_bitmap); |
203 base::StringValue title(text); | 203 base::Value title(text); |
204 base::StringValue icon(icon_str); | 204 base::Value icon(icon_str); |
205 web_ui_->CallJavascriptFunctionUnsafe("cr.ui.DropDown.updateNetworkTitle", | 205 web_ui_->CallJavascriptFunctionUnsafe("cr.ui.DropDown.updateNetworkTitle", |
206 title, icon); | 206 title, icon); |
207 } | 207 } |
208 | 208 |
209 void NetworkDropdown::RequestNetworkScan() { | 209 void NetworkDropdown::RequestNetworkScan() { |
210 NetworkHandler::Get()->network_state_handler()->RequestScan(); | 210 NetworkHandler::Get()->network_state_handler()->RequestScan(); |
211 Refresh(); | 211 Refresh(); |
212 } | 212 } |
213 | 213 |
214 } // namespace chromeos | 214 } // namespace chromeos |
OLD | NEW |