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_menu_button.h" | 5 #include "chrome/browser/chromeos/status/network_menu_button.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // NetworkMenuButton | 95 // NetworkMenuButton |
96 | 96 |
97 NetworkMenuButton::NetworkMenuButton(StatusAreaHost* host) | 97 NetworkMenuButton::NetworkMenuButton(StatusAreaHost* host) |
98 : StatusAreaButton(host, this), | 98 : StatusAreaButton(host, this), |
99 mobile_data_bubble_(NULL), | 99 mobile_data_bubble_(NULL), |
100 is_browser_mode_(false), | 100 is_browser_mode_(false), |
101 check_for_promo_(true), | 101 check_for_promo_(true), |
102 was_sim_locked_(false), | 102 was_sim_locked_(false), |
103 ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) { | 103 ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) { |
104 is_browser_mode_ = (host->GetScreenMode() == StatusAreaHost::kBrowserMode); | 104 is_browser_mode_ = (host->GetScreenMode() == StatusAreaHost::kBrowserMode); |
105 network_menu_.reset(new NetworkMenu(this, is_browser_mode_)); | 105 network_menu_.reset(new NetworkMenuView(this, is_browser_mode_)); |
106 network_icon_.reset( | 106 network_icon_.reset( |
107 new NetworkMenuIcon(this, NetworkMenuIcon::MENU_MODE)); | 107 new NetworkMenuIcon(this, NetworkMenuIcon::MENU_MODE)); |
108 | 108 |
109 NetworkLibrary* network_library = CrosLibrary::Get()->GetNetworkLibrary(); | 109 NetworkLibrary* network_library = CrosLibrary::Get()->GetNetworkLibrary(); |
110 OnNetworkManagerChanged(network_library); | 110 OnNetworkManagerChanged(network_library); |
111 network_library->AddNetworkManagerObserver(this); | 111 network_library->AddNetworkManagerObserver(this); |
112 network_library->AddCellularDataPlanObserver(this); | 112 network_library->AddCellularDataPlanObserver(this); |
113 const NetworkDevice* cellular = network_library->FindCellularDevice(); | 113 const NetworkDevice* cellular = network_library->FindCellularDevice(); |
114 if (cellular) { | 114 if (cellular) { |
115 cellular_device_path_ = cellular->device_path(); | 115 cellular_device_path_ = cellular->device_path(); |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 SetCarrierDealPromoShown(carrier_deal_promo_pref + 1); | 429 SetCarrierDealPromoShown(carrier_deal_promo_pref + 1); |
430 } | 430 } |
431 } | 431 } |
432 | 432 |
433 void NetworkMenuButton::SetTooltipAndAccessibleName(const string16& label) { | 433 void NetworkMenuButton::SetTooltipAndAccessibleName(const string16& label) { |
434 SetTooltipText(UTF16ToWide(label)); | 434 SetTooltipText(UTF16ToWide(label)); |
435 SetAccessibleName(label); | 435 SetAccessibleName(label); |
436 } | 436 } |
437 | 437 |
438 } // namespace chromeos | 438 } // namespace chromeos |
OLD | NEW |