| 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/chromeos/status/network_menu.h" | 5 #include "chrome/browser/chromeos/status/network_menu.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 // NetworkMenuModel implementation. | 204 // NetworkMenuModel implementation. |
| 205 void InitMenuItems(bool should_open_button_options) override; | 205 void InitMenuItems(bool should_open_button_options) override; |
| 206 | 206 |
| 207 // ui::MenuModel implementation | 207 // ui::MenuModel implementation |
| 208 int GetCommandIdAt(int index) const override; | 208 int GetCommandIdAt(int index) const override; |
| 209 | 209 |
| 210 private: | 210 private: |
| 211 void AddWirelessNetworkMenuItem(const NetworkState* wifi_network, int flag); | 211 void AddWirelessNetworkMenuItem(const NetworkState* wifi_network, int flag); |
| 212 void AddMessageItem(const base::string16& msg); | 212 void AddMessageItem(const base::string16& msg); |
| 213 | 213 |
| 214 scoped_ptr<MoreMenuModel> more_menu_model_; | 214 std::unique_ptr<MoreMenuModel> more_menu_model_; |
| 215 | 215 |
| 216 DISALLOW_COPY_AND_ASSIGN(MainMenuModel); | 216 DISALLOW_COPY_AND_ASSIGN(MainMenuModel); |
| 217 }; | 217 }; |
| 218 | 218 |
| 219 //////////////////////////////////////////////////////////////////////////////// | 219 //////////////////////////////////////////////////////////////////////////////// |
| 220 // NetworkMenuModel, public methods: | 220 // NetworkMenuModel, public methods: |
| 221 | 221 |
| 222 void NetworkMenuModel::ConnectToNetworkAt(int index) { | 222 void NetworkMenuModel::ConnectToNetworkAt(int index) { |
| 223 const std::string& service_path = menu_items_[index].service_path; | 223 const std::string& service_path = menu_items_[index].service_path; |
| 224 ui::NetworkConnect::Get()->ConnectToNetwork(service_path); | 224 ui::NetworkConnect::Get()->ConnectToNetwork(service_path); |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 return main_menu_model_.get(); | 677 return main_menu_model_.get(); |
| 678 } | 678 } |
| 679 | 679 |
| 680 void NetworkMenu::UpdateMenu() { | 680 void NetworkMenu::UpdateMenu() { |
| 681 refreshing_menu_ = true; | 681 refreshing_menu_ = true; |
| 682 main_menu_model_->InitMenuItems(delegate_->ShouldOpenButtonOptions()); | 682 main_menu_model_->InitMenuItems(delegate_->ShouldOpenButtonOptions()); |
| 683 refreshing_menu_ = false; | 683 refreshing_menu_ = false; |
| 684 } | 684 } |
| 685 | 685 |
| 686 } // namespace chromeos | 686 } // namespace chromeos |
| OLD | NEW |