| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/chromeos/cros/network_library.h" | 10 #include "chrome/browser/chromeos/cros/network_library.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 NOTREACHED(); | 74 NOTREACHED(); |
| 75 bool oobe; | 75 bool oobe; |
| 76 if (!args->GetBoolean(1, &oobe)) | 76 if (!args->GetBoolean(1, &oobe)) |
| 77 NOTREACHED(); | 77 NOTREACHED(); |
| 78 | 78 |
| 79 | 79 |
| 80 double last_network_type = -1; // Javascript passes integer as double. | 80 double last_network_type = -1; // Javascript passes integer as double. |
| 81 if (!args->GetDouble(2, &last_network_type)) | 81 if (!args->GetDouble(2, &last_network_type)) |
| 82 NOTREACHED(); | 82 NOTREACHED(); |
| 83 | 83 |
| 84 dropdown_.reset(new NetworkDropdown(web_ui_, GetNativeWindow(), oobe)); | 84 dropdown_.reset(new NetworkDropdown(web_ui_, oobe)); |
| 85 | 85 |
| 86 if (last_network_type >= 0) { | 86 if (last_network_type >= 0) { |
| 87 dropdown_->SetLastNetworkType( | 87 dropdown_->SetLastNetworkType( |
| 88 static_cast<ConnectionType>(last_network_type)); | 88 static_cast<ConnectionType>(last_network_type)); |
| 89 } | 89 } |
| 90 } | 90 } |
| 91 | 91 |
| 92 void NetworkDropdownHandler::HandleNetworkDropdownHide( | 92 void NetworkDropdownHandler::HandleNetworkDropdownHide( |
| 93 const base::ListValue* args) { | 93 const base::ListValue* args) { |
| 94 DCHECK(args->GetSize() == 0); | 94 DCHECK(args->GetSize() == 0); |
| 95 dropdown_.reset(); | 95 dropdown_.reset(); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void NetworkDropdownHandler::HandleNetworkDropdownRefresh( | 98 void NetworkDropdownHandler::HandleNetworkDropdownRefresh( |
| 99 const base::ListValue* args) { | 99 const base::ListValue* args) { |
| 100 DCHECK(args->GetSize() == 0); | 100 DCHECK(args->GetSize() == 0); |
| 101 // Since language change is async, | 101 // Since language change is async, |
| 102 // we may in theory be on another screen during this call. | 102 // we may in theory be on another screen during this call. |
| 103 if (dropdown_.get()) | 103 if (dropdown_.get()) |
| 104 dropdown_->Refresh(); | 104 dropdown_->Refresh(); |
| 105 } | 105 } |
| 106 | 106 |
| 107 } // namespace chromeos | 107 } // namespace chromeos |
| OLD | NEW |