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

Side by Side Diff: ash/system/network/network_list.cc

Issue 2957043002: Add a row in the network tray to inform users to turn Bluetooth on to enable Tether. (Closed)
Patch Set: tdanderson@ and khorimoto@ comments Created 3 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ash/system/network/network_list.h" 5 #include "ash/system/network/network_list.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "ash/metrics/user_metrics_recorder.h" 10 #include "ash/metrics/user_metrics_recorder.h"
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 InfoLabel* info_label = *info_label_ptr; 634 InfoLabel* info_label = *info_label_ptr;
635 if (!message_id) { 635 if (!message_id) {
636 if (info_label) { 636 if (info_label) {
637 needs_relayout_ = true; 637 needs_relayout_ = true;
638 delete info_label; 638 delete info_label;
639 *info_label_ptr = nullptr; 639 *info_label_ptr = nullptr;
640 } 640 }
641 return; 641 return;
642 } 642 }
643 if (!info_label) 643 if (!info_label)
644 info_label = new InfoLabel(message_id); 644 info_label = new InfoLabel(message_id, this);
Kyle Horimoto 2017/07/10 18:37:07 /* delegate */
lesliewatkins 2017/07/12 21:49:50 Done.
645 else 645 else
646 info_label->SetMessage(message_id); 646 info_label->Update(message_id);
647
647 PlaceViewAtIndex(info_label, insertion_index); 648 PlaceViewAtIndex(info_label, insertion_index);
648 *info_label_ptr = info_label; 649 *info_label_ptr = info_label;
649 } 650 }
650 651
652 void NetworkListView::OnLabelClicked(TrayDetailsView::InfoLabel* label) {
653 if (label->message_id() == IDS_ASH_STATUS_TRAY_ENABLE_BLUETOOTH)
654 Shell::Get()->system_tray_controller()->ShowBluetoothSettings();
655 }
656
651 int NetworkListView::UpdateSectionHeaderRow(NetworkTypePattern pattern, 657 int NetworkListView::UpdateSectionHeaderRow(NetworkTypePattern pattern,
652 bool enabled, 658 bool enabled,
653 int child_index, 659 int child_index,
654 SectionHeaderRowView** view, 660 SectionHeaderRowView** view,
655 views::Separator** separator_view) { 661 views::Separator** separator_view) {
656 if (!*view) { 662 if (!*view) {
657 if (pattern.MatchesPattern(NetworkTypePattern::Mobile())) 663 if (pattern.MatchesPattern(NetworkTypePattern::Mobile()))
658 *view = new MobileHeaderRowView(); 664 *view = new MobileHeaderRowView();
659 else if (pattern.Equals(NetworkTypePattern::WiFi())) 665 else if (pattern.Equals(NetworkTypePattern::WiFi()))
660 *view = new WifiHeaderRowView(); 666 *view = new WifiHeaderRowView();
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 TriView::Container::CENTER, views::CreateEmptyBorder(gfx::Insets( 726 TriView::Container::CENTER, views::CreateEmptyBorder(gfx::Insets(
721 0, 0, 0, kTrayPopupLabelRightPadding))); 727 0, 0, 0, kTrayPopupLabelRightPadding)));
722 728
723 // Nothing to the right of the text. 729 // Nothing to the right of the text.
724 connection_warning->SetContainerVisible(TriView::Container::END, false); 730 connection_warning->SetContainerVisible(TriView::Container::END, false);
725 return connection_warning; 731 return connection_warning;
726 } 732 }
727 733
728 } // namespace tray 734 } // namespace tray
729 } // namespace ash 735 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698