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/chromeos/status/network_dropdown_button.h" | 5 #include "chrome/browser/chromeos/status/network_dropdown_button.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/chromeos/cros/cros_library.h" | 9 #include "chrome/browser/chromeos/cros/cros_library.h" |
10 #include "chrome/browser/chromeos/login/proxy_settings_dialog.h" | 10 #include "chrome/browser/chromeos/login/proxy_settings_dialog.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 NetworkDropdownButton::NetworkDropdownButton(bool is_browser_mode, | 22 NetworkDropdownButton::NetworkDropdownButton(bool is_browser_mode, |
23 gfx::NativeWindow parent_window, | 23 gfx::NativeWindow parent_window, |
24 bool should_show_options) | 24 bool should_show_options) |
25 : DropDownButton(NULL, | 25 : DropDownButton(NULL, |
26 UTF16ToWide(l10n_util::GetStringUTF16( | 26 UTF16ToWide(l10n_util::GetStringUTF16( |
27 IDS_STATUSBAR_NO_NETWORKS_MESSAGE)), | 27 IDS_STATUSBAR_NO_NETWORKS_MESSAGE)), |
28 this, | 28 this, |
29 true), | 29 true), |
30 parent_window_(parent_window), | 30 parent_window_(parent_window), |
31 should_show_options_(should_show_options) { | 31 should_show_options_(should_show_options) { |
32 network_menu_.reset(new NetworkMenu(this, is_browser_mode)); | 32 network_menu_.reset( |
| 33 new NetworkMenuView(this, is_browser_mode)); |
33 network_icon_.reset( | 34 network_icon_.reset( |
34 new NetworkMenuIcon(this, NetworkMenuIcon::DROPDOWN_MODE)); | 35 new NetworkMenuIcon(this, NetworkMenuIcon::DROPDOWN_MODE)); |
35 CrosLibrary::Get()->GetNetworkLibrary()->AddNetworkManagerObserver(this); | 36 CrosLibrary::Get()->GetNetworkLibrary()->AddNetworkManagerObserver(this); |
36 // The initial state will be updated on Refresh. | 37 // The initial state will be updated on Refresh. |
37 // See network_selection_view.cc. | 38 // See network_selection_view.cc. |
38 } | 39 } |
39 | 40 |
40 NetworkDropdownButton::~NetworkDropdownButton() { | 41 NetworkDropdownButton::~NetworkDropdownButton() { |
41 CrosLibrary::Get()->GetNetworkLibrary()->RemoveNetworkManagerObserver(this); | 42 CrosLibrary::Get()->GetNetworkLibrary()->RemoveNetworkManagerObserver(this); |
42 } | 43 } |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // NetworkDropdownButton, private methods: | 121 // NetworkDropdownButton, private methods: |
121 | 122 |
122 void NetworkDropdownButton::SetNetworkIconAndText() { | 123 void NetworkDropdownButton::SetNetworkIconAndText() { |
123 string16 text; | 124 string16 text; |
124 const SkBitmap* bitmap = network_icon_->GetIconAndText(&text); | 125 const SkBitmap* bitmap = network_icon_->GetIconAndText(&text); |
125 SetIcon(*bitmap); | 126 SetIcon(*bitmap); |
126 SetText(UTF16ToWide(text)); | 127 SetText(UTF16ToWide(text)); |
127 } | 128 } |
128 | 129 |
129 } // namespace chromeos | 130 } // namespace chromeos |
OLD | NEW |