| 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/network_message_observer.h" | 5 #include "chrome/browser/chromeos/network_message_observer.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_delegate.h" | 8 #include "ash/shell_delegate.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 l10n_util::GetStringUTF16(IDS_NETWORK_CONNECTION_ERROR_TITLE)), | 45 l10n_util::GetStringUTF16(IDS_NETWORK_CONNECTION_ERROR_TITLE)), |
| 46 notification_low_data_(profile, "network_low_data.chromeos", | 46 notification_low_data_(profile, "network_low_data.chromeos", |
| 47 IDR_NOTIFICATION_BARS_CRITICAL, | 47 IDR_NOTIFICATION_BARS_CRITICAL, |
| 48 l10n_util::GetStringUTF16(IDS_NETWORK_LOW_DATA_TITLE)), | 48 l10n_util::GetStringUTF16(IDS_NETWORK_LOW_DATA_TITLE)), |
| 49 notification_no_data_(profile, "network_no_data.chromeos", | 49 notification_no_data_(profile, "network_no_data.chromeos", |
| 50 IDR_NOTIFICATION_BARS_EMPTY, | 50 IDR_NOTIFICATION_BARS_EMPTY, |
| 51 l10n_util::GetStringUTF16(IDS_NETWORK_OUT_OF_DATA_TITLE)) { | 51 l10n_util::GetStringUTF16(IDS_NETWORK_OUT_OF_DATA_TITLE)) { |
| 52 NetworkLibrary* netlib = CrosLibrary::Get()->GetNetworkLibrary(); | 52 NetworkLibrary* netlib = CrosLibrary::Get()->GetNetworkLibrary(); |
| 53 OnNetworkManagerChanged(netlib); | 53 OnNetworkManagerChanged(netlib); |
| 54 // Note that this gets added as a NetworkManagerObserver, | 54 // Note that this gets added as a NetworkManagerObserver, |
| 55 // CellularDataPlanObserver, and UserActionObserver in browser_init.cc | 55 // CellularDataPlanObserver, and UserActionObserver in |
| 56 // startup_browser_creator.cc |
| 56 } | 57 } |
| 57 | 58 |
| 58 NetworkMessageObserver::~NetworkMessageObserver() { | 59 NetworkMessageObserver::~NetworkMessageObserver() { |
| 59 NetworkLibrary* netlib = CrosLibrary::Get()->GetNetworkLibrary(); | 60 NetworkLibrary* netlib = CrosLibrary::Get()->GetNetworkLibrary(); |
| 60 netlib->RemoveNetworkManagerObserver(this); | 61 netlib->RemoveNetworkManagerObserver(this); |
| 61 netlib->RemoveCellularDataPlanObserver(this); | 62 netlib->RemoveCellularDataPlanObserver(this); |
| 62 netlib->RemoveUserActionObserver(this); | 63 netlib->RemoveUserActionObserver(this); |
| 63 notification_connection_error_.Hide(); | 64 notification_connection_error_.Hide(); |
| 64 notification_low_data_.Hide(); | 65 notification_low_data_.Hide(); |
| 65 notification_no_data_.Hide(); | 66 notification_no_data_.Hide(); |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 if (plan) { | 278 if (plan) { |
| 278 cellular_data_plan_unique_id_ = plan->GetUniqueIdentifier(); | 279 cellular_data_plan_unique_id_ = plan->GetUniqueIdentifier(); |
| 279 cellular_data_plan_type_ = plan->plan_type; | 280 cellular_data_plan_type_ = plan->plan_type; |
| 280 } else { | 281 } else { |
| 281 cellular_data_plan_unique_id_ = std::string(); | 282 cellular_data_plan_unique_id_ = std::string(); |
| 282 cellular_data_plan_type_ = CELLULAR_DATA_PLAN_UNKNOWN; | 283 cellular_data_plan_type_ = CELLULAR_DATA_PLAN_UNKNOWN; |
| 283 } | 284 } |
| 284 } | 285 } |
| 285 | 286 |
| 286 } // namespace chromeos | 287 } // namespace chromeos |
| OLD | NEW |