| 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_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/network_dropdown_handler.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chromeos/login/webui_login_display.h" | 7 #include "chrome/browser/chromeos/login/webui_login_display.h" |
| 8 #include "chrome/browser/ui/webui/chromeos/login/network_dropdown.h" | 8 #include "chrome/browser/ui/webui/chromeos/login/network_dropdown.h" |
| 9 #include "grit/generated_resources.h" | 9 #include "grit/generated_resources.h" |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 if (dropdown_.get()) { | 50 if (dropdown_.get()) { |
| 51 dropdown_->OnItemChosen(static_cast<int>(id)); | 51 dropdown_->OnItemChosen(static_cast<int>(id)); |
| 52 } else { | 52 } else { |
| 53 // It could happen with very low probability but still keep NOTREACHED to | 53 // It could happen with very low probability but still keep NOTREACHED to |
| 54 // detect if it starts happening all the time. | 54 // detect if it starts happening all the time. |
| 55 NOTREACHED(); | 55 NOTREACHED(); |
| 56 } | 56 } |
| 57 } | 57 } |
| 58 | 58 |
| 59 void NetworkDropdownHandler::HandleNetworkDropdownShow( | 59 void NetworkDropdownHandler::HandleNetworkDropdownShow( |
| 60 const std::string& element_id, bool oobe, double last_network_type) { | 60 const std::string& element_id, bool oobe) { |
| 61 dropdown_.reset(new NetworkDropdown(web_ui(), oobe)); | 61 dropdown_.reset(new NetworkDropdown(web_ui(), oobe)); |
| 62 if (last_network_type >= 0) { | |
| 63 dropdown_->SetLastNetworkType( | |
| 64 static_cast<ConnectionType>(last_network_type)); | |
| 65 } | |
| 66 } | 62 } |
| 67 | 63 |
| 68 void NetworkDropdownHandler::HandleNetworkDropdownHide() { | 64 void NetworkDropdownHandler::HandleNetworkDropdownHide() { |
| 69 dropdown_.reset(); | 65 dropdown_.reset(); |
| 70 } | 66 } |
| 71 | 67 |
| 72 void NetworkDropdownHandler::HandleNetworkDropdownRefresh() { | 68 void NetworkDropdownHandler::HandleNetworkDropdownRefresh() { |
| 73 // Since language change is async, | 69 // Since language change is async, |
| 74 // we may in theory be on another screen during this call. | 70 // we may in theory be on another screen during this call. |
| 75 if (dropdown_.get()) | 71 if (dropdown_.get()) |
| 76 dropdown_->Refresh(); | 72 dropdown_->Refresh(); |
| 77 } | 73 } |
| 78 | 74 |
| 79 } // namespace chromeos | 75 } // namespace chromeos |
| OLD | NEW |