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

Unified Diff: ash/common/system/tray/tray_details_view.cc

Issue 2453133002: [ash-md] Makes Wi-Fi header row sticky when network list is scrolled (Closed)
Patch Set: [ash-md] Makes Wi-Fi header row sticky when network list is scrolled (avoid set_id()) Created 4 years, 1 month 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/tray/tray_details_view.cc
diff --git a/ash/common/system/tray/tray_details_view.cc b/ash/common/system/tray/tray_details_view.cc
index 70ff14fd6b4feb2838251819af30b34515ef2cf2..20988de3422d3fffb89f36d067d2fb9417b2a7ad 100644
--- a/ash/common/system/tray/tray_details_view.cc
+++ b/ash/common/system/tray/tray_details_view.cc
@@ -6,6 +6,7 @@
#include "ash/common/material_design/material_design_controller.h"
#include "ash/common/system/tray/fixed_sized_scroll_view.h"
+#include "ash/common/system/tray/header_list_scroll_view.h"
#include "ash/common/system/tray/system_tray.h"
#include "ash/common/system/tray/system_tray_item.h"
#include "ash/common/system/tray/tray_constants.h"
@@ -65,8 +66,6 @@ class TitleRowSeparatorLayout : public views::LayoutManager {
}
};
-} // namespace
-
class ScrollSeparator : public views::View {
public:
ScrollSeparator() {}
@@ -74,17 +73,20 @@ class ScrollSeparator : public views::View {
~ScrollSeparator() override {}
private:
- // Overriden from views::View.
+ // views::View.
void OnPaint(gfx::Canvas* canvas) override {
- canvas->FillRect(gfx::Rect(0, height() / 2, width(), 1), kBorderLightColor);
+ canvas->FillRect(gfx::Rect(0, height() / 2, width(), 1),
+ ash::kBorderLightColor);
}
gfx::Size GetPreferredSize() const override {
- return gfx::Size(1, kTrayPopupScrollSeparatorHeight);
+ return gfx::Size(1, ash::kTrayPopupScrollSeparatorHeight);
}
DISALLOW_COPY_AND_ASSIGN(ScrollSeparator);
};
+} // namespace
+
class ScrollBorder : public views::Border {
public:
ScrollBorder() {}
@@ -93,7 +95,7 @@ class ScrollBorder : public views::Border {
void set_visible(bool visible) { visible_ = visible; }
private:
- // Overridden from views::Border.
+ // views::Border.
void Paint(const views::View& view, gfx::Canvas* canvas) override {
if (!visible_)
return;
@@ -105,7 +107,7 @@ class ScrollBorder : public views::Border {
gfx::Size GetMinimumSize() const override { return gfx::Size(0, 1); }
- bool visible_;
+ bool visible_ = false;
DISALLOW_COPY_AND_ASSIGN(ScrollBorder);
};
@@ -181,9 +183,7 @@ void TrayDetailsView::CreateTitleRow(int string_id) {
void TrayDetailsView::CreateScrollableList() {
DCHECK(!scroller_);
- scroll_content_ = new views::View;
- scroll_content_->SetLayoutManager(
- new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 1));
+ scroll_content_ = new HeaderListScrollView();
scroller_ = new FixedSizedScrollView;
scroller_->SetContentsView(scroll_content_);

Powered by Google App Engine
This is Rietveld 408576698