| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 gfx::Image icon; | 95 gfx::Image icon; |
| 96 if (model->GetIconAt(i, &icon)) { | 96 if (model->GetIconAt(i, &icon)) { |
| 97 SkBitmap icon_bitmap = icon.ToImageSkia()->GetRepresentation( | 97 SkBitmap icon_bitmap = icon.ToImageSkia()->GetRepresentation( |
| 98 web_ui_->GetDeviceScaleFactor()).sk_bitmap(); | 98 web_ui_->GetDeviceScaleFactor()).sk_bitmap(); |
| 99 item->SetString("icon", webui::GetBitmapDataUrl(icon_bitmap)); | 99 item->SetString("icon", webui::GetBitmapDataUrl(icon_bitmap)); |
| 100 } | 100 } |
| 101 if (id >= 0) { | 101 if (id >= 0) { |
| 102 item->SetBoolean("enabled", model->IsEnabledAt(i)); | 102 item->SetBoolean("enabled", model->IsEnabledAt(i)); |
| 103 const gfx::FontList* font_list = model->GetLabelFontListAt(i); | 103 const gfx::FontList* font_list = model->GetLabelFontListAt(i); |
| 104 if (font_list) | 104 if (font_list) |
| 105 item->SetBoolean("bold", font_list->GetFontStyle() == gfx::Font::BOLD); | 105 item->SetBoolean("bold", |
| 106 font_list->GetFontWeight() == gfx::Font::Weight::BOLD); |
| 106 } | 107 } |
| 107 if (type == ui::MenuModel::TYPE_SUBMENU) | 108 if (type == ui::MenuModel::TYPE_SUBMENU) |
| 108 item->Set("sub", ConvertMenuModel(model->GetSubmenuModelAt(i))); | 109 item->Set("sub", ConvertMenuModel(model->GetSubmenuModelAt(i))); |
| 109 list->Append(item); | 110 list->Append(item); |
| 110 } | 111 } |
| 111 return list; | 112 return list; |
| 112 } | 113 } |
| 113 | 114 |
| 114 // NetworkDropdown ------------------------------------------------------------- | 115 // NetworkDropdown ------------------------------------------------------------- |
| 115 | 116 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 web_ui_->CallJavascriptFunction("cr.ui.DropDown.updateNetworkTitle", | 204 web_ui_->CallJavascriptFunction("cr.ui.DropDown.updateNetworkTitle", |
| 204 title, icon); | 205 title, icon); |
| 205 } | 206 } |
| 206 | 207 |
| 207 void NetworkDropdown::RequestNetworkScan() { | 208 void NetworkDropdown::RequestNetworkScan() { |
| 208 NetworkHandler::Get()->network_state_handler()->RequestScan(); | 209 NetworkHandler::Get()->network_state_handler()->RequestScan(); |
| 209 Refresh(); | 210 Refresh(); |
| 210 } | 211 } |
| 211 | 212 |
| 212 } // namespace chromeos | 213 } // namespace chromeos |
| OLD | NEW |