Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(480)

Unified Diff: ash/common/system/chromeos/network/network_list_md.cc

Issue 2742513003: Revert of Remove a lot of pre-MD code from NetworkStateListDetailedView (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/common/system/chromeos/network/network_list_md.cc
diff --git a/ash/common/system/chromeos/network/network_list_md.cc b/ash/common/system/chromeos/network/network_list_md.cc
index d0bba2ac38a5d4d132b3cc4116bf2f5bc0f45d73..534466698259115e90f590fa481a2310a577b509 100644
--- a/ash/common/system/chromeos/network/network_list_md.cc
+++ b/ash/common/system/chromeos/network/network_list_md.cc
@@ -75,8 +75,8 @@
// A header row for sections in network detailed view which contains a title and
// a toggle button to turn on/off the section. Subclasses are given the
// opportunity to add extra buttons before the toggle button is added.
-class NetworkListView::SectionHeaderRowView : public views::View,
- public views::ButtonListener {
+class NetworkListViewMd::SectionHeaderRowView : public views::View,
+ public views::ButtonListener {
public:
explicit SectionHeaderRowView(int title_id)
: title_id_(title_id),
@@ -123,7 +123,7 @@
// In the event of frequent clicks, helps to prevent a toggle button state
// from becoming inconsistent with the async operation of enabling /
// disabling of mobile radio. The toggle will get re-enabled in the next
- // call to NetworkListView::Update().
+ // call to NetworkListViewMd::Update().
toggle_->SetEnabled(false);
OnToggleToggled(toggle_->is_on());
}
@@ -169,7 +169,7 @@
namespace {
-class CellularHeaderRowView : public NetworkListView::SectionHeaderRowView {
+class CellularHeaderRowView : public NetworkListViewMd::SectionHeaderRowView {
public:
CellularHeaderRowView()
: SectionHeaderRowView(IDS_ASH_STATUS_TRAY_NETWORK_MOBILE) {}
@@ -190,7 +190,7 @@
DISALLOW_COPY_AND_ASSIGN(CellularHeaderRowView);
};
-class TetherHeaderRowView : public NetworkListView::SectionHeaderRowView {
+class TetherHeaderRowView : public NetworkListViewMd::SectionHeaderRowView {
public:
TetherHeaderRowView()
: SectionHeaderRowView(IDS_ASH_STATUS_TRAY_NETWORK_TETHER) {}
@@ -208,7 +208,7 @@
DISALLOW_COPY_AND_ASSIGN(TetherHeaderRowView);
};
-class WifiHeaderRowView : public NetworkListView::SectionHeaderRowView {
+class WifiHeaderRowView : public NetworkListViewMd::SectionHeaderRowView {
public:
explicit WifiHeaderRowView(NetworkListDelegate* network_list_delegate)
: SectionHeaderRowView(IDS_ASH_STATUS_TRAY_NETWORK_WIFI),
@@ -281,9 +281,9 @@
} // namespace
-// NetworkListView:
-
-NetworkListView::NetworkListView(NetworkListDelegate* delegate)
+// NetworkListViewMd:
+
+NetworkListViewMd::NetworkListViewMd(NetworkListDelegate* delegate)
: needs_relayout_(false),
delegate_(delegate),
no_wifi_networks_view_(nullptr),
@@ -297,11 +297,11 @@
CHECK(delegate_);
}
-NetworkListView::~NetworkListView() {
+NetworkListViewMd::~NetworkListViewMd() {
network_icon::NetworkIconAnimation::GetInstance()->RemoveObserver(this);
}
-void NetworkListView::Update() {
+void NetworkListViewMd::Update() {
CHECK(container());
NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler();
@@ -322,8 +322,8 @@
UpdateNetworkListInternal();
}
-bool NetworkListView::IsNetworkEntry(views::View* view,
- std::string* guid) const {
+bool NetworkListViewMd::IsNetworkEntry(views::View* view,
+ std::string* guid) const {
std::map<views::View*, std::string>::const_iterator found =
network_map_.find(view);
if (found == network_map_.end())
@@ -332,7 +332,7 @@
return true;
}
-void NetworkListView::UpdateNetworks(
+void NetworkListViewMd::UpdateNetworks(
const NetworkStateHandler::NetworkStateList& networks) {
SCOPED_NET_LOG_IF_SLOW();
network_list_.clear();
@@ -343,7 +343,7 @@
}
}
-void NetworkListView::OrderNetworks() {
+void NetworkListViewMd::OrderNetworks() {
struct CompareNetwork {
explicit CompareNetwork(NetworkStateHandler* handler) : handler_(handler) {}
@@ -387,7 +387,7 @@
CompareNetwork(NetworkHandler::Get()->network_state_handler()));
}
-void NetworkListView::UpdateNetworkIcons() {
+void NetworkListViewMd::UpdateNetworkIcons() {
SCOPED_NET_LOG_IF_SLOW();
NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler();
@@ -429,7 +429,7 @@
network_icon::NetworkIconAnimation::GetInstance()->RemoveObserver(this);
}
-void NetworkListView::UpdateNetworkListInternal() {
+void NetworkListViewMd::UpdateNetworkListInternal() {
SCOPED_NET_LOG_IF_SLOW();
// Get the updated list entries.
needs_relayout_ = false;
@@ -467,7 +467,7 @@
}
std::unique_ptr<std::set<std::string>>
-NetworkListView::UpdateNetworkListEntries() {
+NetworkListViewMd::UpdateNetworkListEntries() {
NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler();
// First add high-priority networks (not Wi-Fi nor cellular).
@@ -556,7 +556,7 @@
return new_guids;
}
-std::unique_ptr<std::set<std::string>> NetworkListView::UpdateNetworkChildren(
+std::unique_ptr<std::set<std::string>> NetworkListViewMd::UpdateNetworkChildren(
NetworkInfo::Type type,
int index) {
std::unique_ptr<std::set<std::string>> new_guids(new std::set<std::string>);
@@ -569,7 +569,7 @@
return new_guids;
}
-void NetworkListView::UpdateNetworkChild(int index, const NetworkInfo* info) {
+void NetworkListViewMd::UpdateNetworkChild(int index, const NetworkInfo* info) {
views::View* network_view = nullptr;
NetworkGuidMap::const_iterator found = network_guid_map_.find(info->guid);
if (found == network_guid_map_.end()) {
@@ -588,7 +588,7 @@
network_guid_map_[info->guid] = network_view;
}
-void NetworkListView::PlaceViewAtIndex(views::View* view, int index) {
+void NetworkListViewMd::PlaceViewAtIndex(views::View* view, int index) {
if (view->parent() != container()) {
container()->AddChildViewAt(view, index);
} else {
@@ -599,9 +599,9 @@
needs_relayout_ = true;
}
-void NetworkListView::UpdateInfoLabel(int message_id,
- int insertion_index,
- views::Label** label_ptr) {
+void NetworkListViewMd::UpdateInfoLabel(int message_id,
+ int insertion_index,
+ views::Label** label_ptr) {
views::Label* label = *label_ptr;
if (!message_id) {
if (label) {
@@ -620,11 +620,12 @@
*label_ptr = label;
}
-int NetworkListView::UpdateSectionHeaderRow(NetworkTypePattern pattern,
- bool enabled,
- int child_index,
- SectionHeaderRowView** view,
- views::Separator** separator_view) {
+int NetworkListViewMd::UpdateSectionHeaderRow(
+ NetworkTypePattern pattern,
+ bool enabled,
+ int child_index,
+ SectionHeaderRowView** view,
+ views::Separator** separator_view) {
if (!*view) {
if (pattern.Equals(NetworkTypePattern::Cellular()))
*view = new CellularHeaderRowView();
@@ -653,7 +654,7 @@
return child_index;
}
-void NetworkListView::NetworkIconChanged() {
+void NetworkListViewMd::NetworkIconChanged() {
Update();
}

Powered by Google App Engine
This is Rietveld 408576698