Commit 1653e00e authored by estade's avatar estade Committed by Commit bot

Remove pre-MD code from TrayDetailsView.

Remove SpecialPopupRow.

BUG=686220

Review-Url: https://codereview.chromium.org/2780743002
Cr-Commit-Position: refs/heads/master@{#460527}
parent c785f2a0
...@@ -368,8 +368,6 @@ component("ash") { ...@@ -368,8 +368,6 @@ component("ash") {
"common/system/tray/label_tray_view.h", "common/system/tray/label_tray_view.h",
"common/system/tray/size_range_layout.cc", "common/system/tray/size_range_layout.cc",
"common/system/tray/size_range_layout.h", "common/system/tray/size_range_layout.h",
"common/system/tray/special_popup_row.cc",
"common/system/tray/special_popup_row.h",
"common/system/tray/system_menu_button.cc", "common/system/tray/system_menu_button.cc",
"common/system/tray/system_menu_button.h", "common/system/tray/system_menu_button.h",
"common/system/tray/system_tray.cc", "common/system/tray/system_tray.cc",
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "ash/common/system/tray/tray_constants.h" #include "ash/common/system/tray/tray_constants.h"
#include "ash/common/wm_shell.h" #include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h" #include "ash/common/wm_window.h"
#include "ash/resources/vector_icons/vector_icons.h"
#include "ash/root_window_controller.h" #include "ash/root_window_controller.h"
#include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/dbus_thread_manager.h"
#include "ui/display/display.h" #include "ui/display/display.h"
......
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/common/system/tray/special_popup_row.h"
#include "ash/common/ash_constants.h"
#include "ash/common/material_design/material_design_controller.h"
#include "ash/common/system/tray/hover_highlight_view.h"
#include "ash/common/system/tray/throbber_view.h"
#include "ash/common/system/tray/tray_constants.h"
#include "ash/common/system/tray/tray_popup_header_button.h"
#include "ash/resources/grit/ash_resources.h"
#include "ash/strings/grit/ash_strings.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/views/background.h"
#include "ui/views/border.h"
#include "ui/views/controls/button/custom_button.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/separator.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/painter.h"
namespace ash {
namespace {
const int kIconPaddingLeft = 5;
const int kSeparatorInset = 10;
const int kSpecialPopupRowHeight = 55;
const int kBorderHeight = 1;
const SkColor kBorderColor = SkColorSetRGB(0xaa, 0xaa, 0xaa);
views::View* CreateViewContainer() {
views::View* view = new views::View;
view->SetLayoutManager(
new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0));
view->SetBorder(views::CreateEmptyBorder(4, 0, 4, 5));
return view;
}
} // namespace
SpecialPopupRow::SpecialPopupRow()
: content_(nullptr), views_after_content_container_(nullptr) {
DCHECK(!MaterialDesignController::IsSystemTrayMenuMaterial());
set_background(
views::Background::CreateSolidBackground(kHeaderBackgroundColor));
SetBorder(
views::CreateSolidSidedBorder(kBorderHeight, 0, 0, 0, kBorderColor));
}
SpecialPopupRow::~SpecialPopupRow() {}
void SpecialPopupRow::SetTextLabel(int string_id, ViewClickListener* listener) {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
HoverHighlightView* container = new HoverHighlightView(listener);
container->SetLayoutManager(new views::BoxLayout(
views::BoxLayout::kHorizontal, 0, 3, kIconPaddingLeft));
container->set_highlight_color(SkColorSetARGB(0, 0, 0, 0));
container->set_default_color(SkColorSetARGB(0, 0, 0, 0));
container->set_text_highlight_color(kHeaderTextColorHover);
container->set_text_default_color(kHeaderTextColorNormal);
container->AddIconAndLabel(
*rb.GetImageNamed(IDR_AURA_UBER_TRAY_LESS).ToImageSkia(),
rb.GetLocalizedString(string_id), true /* highlight */);
container->SetBorder(
views::CreateEmptyBorder(0, kTrayPopupPaddingHorizontal, 0, 0));
container->SetAccessibleName(
rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_PREVIOUS_MENU));
SetContent(container);
}
void SpecialPopupRow::SetContent(views::View* view) {
CHECK(!content_);
views::BoxLayout* box_layout =
new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0);
SetLayoutManager(box_layout);
content_ = view;
AddChildViewAt(content_, 0);
}
void SpecialPopupRow::AddViewToTitleRow(views::View* view) {
AddViewAfterContent(view);
}
void SpecialPopupRow::AddViewToRowNonMd(views::View* view, bool add_separator) {
AddViewAfterContent(view, add_separator);
}
gfx::Size SpecialPopupRow::GetPreferredSize() const {
gfx::Size size = views::View::GetPreferredSize();
size.set_height(kSpecialPopupRowHeight);
return size;
}
int SpecialPopupRow::GetHeightForWidth(int width) const {
return kSpecialPopupRowHeight;
}
void SpecialPopupRow::Layout() {
views::View::Layout();
const gfx::Rect content_bounds = GetContentsBounds();
if (content_bounds.IsEmpty())
return;
if (!views_after_content_container_) {
content_->SetBoundsRect(GetContentsBounds());
return;
}
gfx::Rect bounds(views_after_content_container_->GetPreferredSize());
bounds.set_height(content_bounds.height());
gfx::Rect container_bounds = content_bounds;
container_bounds.ClampToCenteredSize(bounds.size());
container_bounds.set_x(content_bounds.width() - container_bounds.width());
views_after_content_container_->SetBoundsRect(container_bounds);
bounds = content_->bounds();
bounds.set_width(views_after_content_container_->x());
content_->SetBoundsRect(bounds);
}
void SpecialPopupRow::AddViewAfterContent(views::View* view) {
AddViewAfterContent(view, false);
}
void SpecialPopupRow::AddViewAfterContent(views::View* view,
bool add_separator) {
if (!views_after_content_container_) {
views_after_content_container_ = CreateViewContainer();
AddChildView(views_after_content_container_);
}
if (add_separator) {
views::Separator* separator = new views::Separator();
separator->SetColor(ash::kBorderDarkColor);
separator->SetBorder(
views::CreateEmptyBorder(kSeparatorInset, 0, kSeparatorInset, 0));
views_after_content_container_->AddChildView(separator);
}
views_after_content_container_->AddChildView(view);
}
} // namespace ash
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ASH_COMMON_SYSTEM_TRAY_SPECIAL_POPUP_ROW_H_
#define ASH_COMMON_SYSTEM_TRAY_SPECIAL_POPUP_ROW_H_
#include "ash/ash_export.h"
#include "ash/common/login_status.h"
#include "ash/resources/vector_icons/vector_icons.h"
#include "base/macros.h"
#include "ui/gfx/geometry/size.h"
#include "ui/views/view.h"
namespace ash {
class ViewClickListener;
// Not used in material design. This class represents the bottom row of
// detailed views and the bottom row of the system menu (date, help, power,
// and lock). This row has a fixed height.
// TODO(tdanderson): Remove this class when material design is enabled by
// default. See crbug.com/614453.
class ASH_EXPORT SpecialPopupRow : public views::View {
public:
SpecialPopupRow();
~SpecialPopupRow() override;
// Creates a text label corresponding to |string_id| and sets it as the
// content of this row.
void SetTextLabel(int string_id, ViewClickListener* listener);
// Sets |content_| to be |view| and adds |content_| as a child view of this
// row. This should only be called once, upon initialization of the row.
void SetContent(views::View* view);
// Adds |view| after this row's content.
void AddViewToTitleRow(views::View* view);
// Adds |view| after this row's content, optionally with a separator. Only
// used for non-MD.
void AddViewToRowNonMd(views::View* view, bool add_separator);
views::View* content() const { return content_; }
private:
// views::View:
gfx::Size GetPreferredSize() const override;
int GetHeightForWidth(int width) const override;
void Layout() override;
// Used to add views to |views_after_content_container_|, respectively. Views
// are added in a left-to-right order.
void AddViewAfterContent(views::View* view);
void AddViewAfterContent(views::View* view, bool add_separator);
// The main content of this row, typically a label.
views::View* content_;
// The container for the views positioned after |content_|.
views::View* views_after_content_container_;
DISALLOW_COPY_AND_ASSIGN(SpecialPopupRow);
};
} // namespace ash
#endif // ASH_COMMON_SYSTEM_TRAY_SPECIAL_POPUP_ROW_H_
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include "ash/common/system/tray/tray_details_view.h" #include "ash/common/system/tray/tray_details_view.h"
#include "ash/common/ash_view_ids.h" #include "ash/common/ash_view_ids.h"
#include "ash/common/material_design/material_design_controller.h"
#include "ash/common/system/tray/system_menu_button.h" #include "ash/common/system/tray/system_menu_button.h"
#include "ash/common/system/tray/system_tray.h" #include "ash/common/system/tray/system_tray.h"
#include "ash/common/system/tray/system_tray_item.h" #include "ash/common/system/tray/system_tray_item.h"
...@@ -35,10 +34,6 @@ ...@@ -35,10 +34,6 @@
namespace ash { namespace ash {
namespace { namespace {
bool UseMd() {
return MaterialDesignController::IsSystemTrayMenuMaterial();
}
// The index of the horizontal rule below the title row. // The index of the horizontal rule below the title row.
const int kTitleRowSeparatorIndex = 1; const int kTitleRowSeparatorIndex = 1;
...@@ -50,11 +45,8 @@ const int kTitleRowSeparatorIndex = 1; ...@@ -50,11 +45,8 @@ const int kTitleRowSeparatorIndex = 1;
class ScrollContentsView : public views::View { class ScrollContentsView : public views::View {
public: public:
ScrollContentsView() ScrollContentsView()
: box_layout_(new views::BoxLayout( : box_layout_(
views::BoxLayout::kVertical, new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)) {
0,
0,
UseMd() ? 0 : kContentsBetweenChildSpacingNonMd)) {
SetLayoutManager(box_layout_); SetLayoutManager(box_layout_);
} }
~ScrollContentsView() override {} ~ScrollContentsView() override {}
...@@ -133,9 +125,6 @@ class ScrollContentsView : public views::View { ...@@ -133,9 +125,6 @@ class ScrollContentsView : public views::View {
private: private:
const int kShadowOffsetY = 2; const int kShadowOffsetY = 2;
const int kShadowBlur = 2; const int kShadowBlur = 2;
// TODO(fukino): Remove this constant once we stop maintaining pre-MD design.
// crbug.com/614453.
const int kContentsBetweenChildSpacingNonMd = 1;
// A structure that keeps the original offset of each header between the // A structure that keeps the original offset of each header between the
// calls to Layout() to allow keeping track of which view should be sticky. // calls to Layout() to allow keeping track of which view should be sticky.
...@@ -231,7 +220,7 @@ class ScrollContentsView : public views::View { ...@@ -231,7 +220,7 @@ class ScrollContentsView : public views::View {
DISALLOW_COPY_AND_ASSIGN(ScrollContentsView); DISALLOW_COPY_AND_ASSIGN(ScrollContentsView);
}; };
// Constants for the title row in material design. // Constants for the title row.
const int kTitleRowVerticalPadding = 4; const int kTitleRowVerticalPadding = 4;
const int kTitleRowProgressBarHeight = 2; const int kTitleRowProgressBarHeight = 2;
const int kTitleRowPaddingTop = kTitleRowVerticalPadding; const int kTitleRowPaddingTop = kTitleRowVerticalPadding;
...@@ -258,39 +247,12 @@ class ScrollSeparator : public views::View { ...@@ -258,39 +247,12 @@ class ScrollSeparator : public views::View {
} // namespace } // namespace
class ScrollBorder : public views::Border {
public:
ScrollBorder() {}
~ScrollBorder() override {}
void set_visible(bool visible) { visible_ = visible; }
private:
// views::Border:
void Paint(const views::View& view, gfx::Canvas* canvas) override {
if (!visible_)
return;
canvas->FillRect(gfx::Rect(0, view.height() - 1, view.width(), 1),
kBorderLightColor);
}
gfx::Insets GetInsets() const override { return gfx::Insets(0, 0, 1, 0); }
gfx::Size GetMinimumSize() const override { return gfx::Size(0, 1); }
bool visible_ = false;
DISALLOW_COPY_AND_ASSIGN(ScrollBorder);
};
TrayDetailsView::TrayDetailsView(SystemTrayItem* owner) TrayDetailsView::TrayDetailsView(SystemTrayItem* owner)
: owner_(owner), : owner_(owner),
box_layout_(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)), box_layout_(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)),
title_row_(nullptr),
scroller_(nullptr), scroller_(nullptr),
scroll_content_(nullptr), scroll_content_(nullptr),
progress_bar_(nullptr), progress_bar_(nullptr),
scroll_border_(nullptr),
tri_view_(nullptr), tri_view_(nullptr),
back_button_(nullptr) { back_button_(nullptr) {
SetLayoutManager(box_layout_); SetLayoutManager(box_layout_);
...@@ -300,17 +262,12 @@ TrayDetailsView::TrayDetailsView(SystemTrayItem* owner) ...@@ -300,17 +262,12 @@ TrayDetailsView::TrayDetailsView(SystemTrayItem* owner)
TrayDetailsView::~TrayDetailsView() {} TrayDetailsView::~TrayDetailsView() {}
void TrayDetailsView::OnViewClicked(views::View* sender) { void TrayDetailsView::OnViewClicked(views::View* sender) {
if (!UseMd() && title_row_ && sender == title_row_->content()) {
TransitionToDefaultView();
return;
}
HandleViewClicked(sender); HandleViewClicked(sender);
} }
void TrayDetailsView::ButtonPressed(views::Button* sender, void TrayDetailsView::ButtonPressed(views::Button* sender,
const ui::Event& event) { const ui::Event& event) {
if (UseMd() && sender == back_button_) { if (sender == back_button_) {
TransitionToDefaultView(); TransitionToDefaultView();
return; return;
} }
...@@ -320,36 +277,29 @@ void TrayDetailsView::ButtonPressed(views::Button* sender, ...@@ -320,36 +277,29 @@ void TrayDetailsView::ButtonPressed(views::Button* sender,
void TrayDetailsView::CreateTitleRow(int string_id) { void TrayDetailsView::CreateTitleRow(int string_id) {
DCHECK(!tri_view_); DCHECK(!tri_view_);
DCHECK(!title_row_);
tri_view_ = TrayPopupUtils::CreateDefaultRowView();
if (UseMd()) {
tri_view_ = TrayPopupUtils::CreateDefaultRowView(); back_button_ = CreateBackButton();
tri_view_->AddView(TriView::Container::START, back_button_);
back_button_ = CreateBackButton();
tri_view_->AddView(TriView::Container::START, back_button_); ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
auto* label = TrayPopupUtils::CreateDefaultLabel();
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); label->SetText(rb.GetLocalizedString(string_id));
auto* label = TrayPopupUtils::CreateDefaultLabel(); TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::TITLE);
label->SetText(rb.GetLocalizedString(string_id)); style.SetupLabel(label);
TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::TITLE); tri_view_->AddView(TriView::Container::CENTER, label);
style.SetupLabel(label);
tri_view_->AddView(TriView::Container::CENTER, label); tri_view_->SetContainerVisible(TriView::Container::END, false);
tri_view_->SetContainerVisible(TriView::Container::END, false); tri_view_->SetBorder(views::CreateEmptyBorder(kTitleRowPaddingTop, 0,
kTitleRowPaddingBottom, 0));
tri_view_->SetBorder(views::CreateEmptyBorder(kTitleRowPaddingTop, 0, AddChildViewAt(tri_view_, 0);
kTitleRowPaddingBottom, 0)); views::Separator* separator = new views::Separator();
AddChildViewAt(tri_view_, 0); separator->SetColor(kMenuSeparatorColor);
views::Separator* separator = new views::Separator(); separator->SetBorder(views::CreateEmptyBorder(
separator->SetColor(kMenuSeparatorColor); kTitleRowProgressBarHeight - views::Separator::kThickness, 0, 0, 0));
separator->SetBorder(views::CreateEmptyBorder( AddChildViewAt(separator, kTitleRowSeparatorIndex);
kTitleRowProgressBarHeight - views::Separator::kThickness, 0, 0, 0));
AddChildViewAt(separator, kTitleRowSeparatorIndex);
} else {
title_row_ = new SpecialPopupRow();
title_row_->SetTextLabel(string_id, this);
AddChildViewAt(title_row_, child_count());
}
CreateExtraTitleRowButtons(); CreateExtraTitleRowButtons();
Layout(); Layout();
...@@ -367,14 +317,6 @@ void TrayDetailsView::CreateScrollableList() { ...@@ -367,14 +317,6 @@ void TrayDetailsView::CreateScrollableList() {
views::Background::CreateSolidBackground(kBackgroundColor)); views::Background::CreateSolidBackground(kBackgroundColor));
scroller_->layer()->SetMasksToBounds(true); scroller_->layer()->SetMasksToBounds(true);
// Note: |scroller_| takes ownership of |scroll_border_|.
if (!UseMd()) {
// In MD, the scroller is always the last thing, so this border is
// unnecessary and reserves extra space we don't want.
scroll_border_ = new ScrollBorder;
scroller_->SetBorder(std::unique_ptr<views::Border>(scroll_border_));
}
AddChildView(scroller_); AddChildView(scroller_);
box_layout_->SetFlexForView(scroller_, 1); box_layout_->SetFlexForView(scroller_, 1);
} }
...@@ -389,7 +331,6 @@ void TrayDetailsView::AddScrollSeparator() { ...@@ -389,7 +331,6 @@ void TrayDetailsView::AddScrollSeparator() {
void TrayDetailsView::Reset() { void TrayDetailsView::Reset() {
RemoveAllChildViews(true); RemoveAllChildViews(true);
title_row_ = nullptr;
scroller_ = nullptr; scroller_ = nullptr;
scroll_content_ = nullptr; scroll_content_ = nullptr;
progress_bar_ = nullptr; progress_bar_ = nullptr;
...@@ -398,7 +339,6 @@ void TrayDetailsView::Reset() { ...@@ -398,7 +339,6 @@ void TrayDetailsView::Reset() {
} }
void TrayDetailsView::ShowProgress(double value, bool visible) { void TrayDetailsView::ShowProgress(double value, bool visible) {
DCHECK(UseMd());
DCHECK(tri_view_); DCHECK(tri_view_);
if (!progress_bar_) { if (!progress_bar_) {
progress_bar_ = new views::ProgressBar(kTitleRowProgressBarHeight); progress_bar_ = new views::ProgressBar(kTitleRowProgressBarHeight);
...@@ -414,7 +354,6 @@ void TrayDetailsView::ShowProgress(double value, bool visible) { ...@@ -414,7 +354,6 @@ void TrayDetailsView::ShowProgress(double value, bool visible) {
views::CustomButton* TrayDetailsView::CreateSettingsButton( views::CustomButton* TrayDetailsView::CreateSettingsButton(
LoginStatus status, LoginStatus status,
int setting_accessible_name_id) { int setting_accessible_name_id) {
DCHECK(UseMd());
SystemMenuButton* button = SystemMenuButton* button =
new SystemMenuButton(this, TrayPopupInkDropStyle::HOST_CENTERED, new SystemMenuButton(this, TrayPopupInkDropStyle::HOST_CENTERED,
kSystemMenuSettingsIcon, setting_accessible_name_id); kSystemMenuSettingsIcon, setting_accessible_name_id);
...@@ -424,7 +363,6 @@ views::CustomButton* TrayDetailsView::CreateSettingsButton( ...@@ -424,7 +363,6 @@ views::CustomButton* TrayDetailsView::CreateSettingsButton(
} }
views::CustomButton* TrayDetailsView::CreateHelpButton(LoginStatus status) { views::CustomButton* TrayDetailsView::CreateHelpButton(LoginStatus status) {
DCHECK(UseMd());
SystemMenuButton* button = SystemMenuButton* button =
new SystemMenuButton(this, TrayPopupInkDropStyle::HOST_CENTERED, new SystemMenuButton(this, TrayPopupInkDropStyle::HOST_CENTERED,
kSystemMenuHelpIcon, IDS_ASH_STATUS_TRAY_HELP); kSystemMenuHelpIcon, IDS_ASH_STATUS_TRAY_HELP);
...@@ -445,17 +383,8 @@ void TrayDetailsView::HandleButtonPressed(views::Button* sender, ...@@ -445,17 +383,8 @@ void TrayDetailsView::HandleButtonPressed(views::Button* sender,
void TrayDetailsView::CreateExtraTitleRowButtons() {} void TrayDetailsView::CreateExtraTitleRowButtons() {}
void TrayDetailsView::TransitionToDefaultView() { void TrayDetailsView::TransitionToDefaultView() {
if (UseMd()) { if (back_button_ && back_button_->HasFocus())
if (back_button_ && back_button_->HasFocus()) owner_->set_restore_focus(true);
owner_->set_restore_focus(true);
} else {
if (title_row_ && title_row_->content() &&
title_row_->content()->HasFocus()) {
owner_->set_restore_focus(true);
}
DoTransitionToDefaultView();
return;
}
transition_delay_timer_.Start( transition_delay_timer_.Start(
FROM_HERE, FROM_HERE,
...@@ -472,7 +401,6 @@ void TrayDetailsView::DoTransitionToDefaultView() { ...@@ -472,7 +401,6 @@ void TrayDetailsView::DoTransitionToDefaultView() {
} }
views::Button* TrayDetailsView::CreateBackButton() { views::Button* TrayDetailsView::CreateBackButton() {
DCHECK(UseMd());
SystemMenuButton* button = new SystemMenuButton( SystemMenuButton* button = new SystemMenuButton(
this, TrayPopupInkDropStyle::HOST_CENTERED, kSystemMenuArrowBackIcon, this, TrayPopupInkDropStyle::HOST_CENTERED, kSystemMenuArrowBackIcon,
IDS_ASH_STATUS_TRAY_PREVIOUS_MENU); IDS_ASH_STATUS_TRAY_PREVIOUS_MENU);
...@@ -486,7 +414,7 @@ void TrayDetailsView::Layout() { ...@@ -486,7 +414,7 @@ void TrayDetailsView::Layout() {
} }
int TrayDetailsView::GetHeightForWidth(int width) const { int TrayDetailsView::GetHeightForWidth(int width) const {
if (!UseMd() || bounds().IsEmpty()) if (bounds().IsEmpty())
return views::View::GetHeightForWidth(width); return views::View::GetHeightForWidth(width);
// The height of the bubble that contains this detailed view is set to // The height of the bubble that contains this detailed view is set to
...@@ -495,16 +423,4 @@ int TrayDetailsView::GetHeightForWidth(int width) const { ...@@ -495,16 +423,4 @@ int TrayDetailsView::GetHeightForWidth(int width) const {
return height(); return height();
} }
void TrayDetailsView::OnPaintBorder(gfx::Canvas* canvas) {
if (scroll_border_) {
int index = GetIndexOf(scroller_);
if (index < child_count() - 1 && child_at(index + 1) != title_row_)
scroll_border_->set_visible(true);
else
scroll_border_->set_visible(false);
}
views::View::OnPaintBorder(canvas);
}
} // namespace ash } // namespace ash
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include <memory> #include <memory>
#include "ash/ash_export.h" #include "ash/ash_export.h"
#include "ash/common/system/tray/special_popup_row.h" #include "ash/common/login_status.h"
#include "ash/common/system/tray/tray_constants.h" #include "ash/common/system/tray/tray_constants.h"
#include "ash/common/system/tray/view_click_listener.h" #include "ash/common/system/tray/view_click_listener.h"
#include "base/macros.h" #include "base/macros.h"
...@@ -48,7 +48,6 @@ class ASH_EXPORT TrayDetailsView : public views::View, ...@@ -48,7 +48,6 @@ class ASH_EXPORT TrayDetailsView : public views::View,
void ButtonPressed(views::Button* sender, const ui::Event& event) final; void ButtonPressed(views::Button* sender, const ui::Event& event) final;
SystemTrayItem* owner() { return owner_; } SystemTrayItem* owner() { return owner_; }
SpecialPopupRow* title_row() { return title_row_; }
views::ScrollView* scroller() { return scroller_; } views::ScrollView* scroller() { return scroller_; }
views::View* scroll_content() { return scroll_content_; } views::View* scroll_content() { return scroll_content_; }
...@@ -56,7 +55,6 @@ class ASH_EXPORT TrayDetailsView : public views::View, ...@@ -56,7 +55,6 @@ class ASH_EXPORT TrayDetailsView : public views::View,
// views::View: // views::View:
void Layout() override; void Layout() override;
int GetHeightForWidth(int width) const override; int GetHeightForWidth(int width) const override;
void OnPaintBorder(gfx::Canvas* canvas) override;
// Exposes the layout manager of this view to give control to subclasses. // Exposes the layout manager of this view to give control to subclasses.
views::BoxLayout* box_layout() { return box_layout_; } views::BoxLayout* box_layout() { return box_layout_; }
...@@ -121,7 +119,6 @@ class ASH_EXPORT TrayDetailsView : public views::View, ...@@ -121,7 +119,6 @@ class ASH_EXPORT TrayDetailsView : public views::View,
SystemTrayItem* owner_; SystemTrayItem* owner_;
views::BoxLayout* box_layout_; views::BoxLayout* box_layout_;
SpecialPopupRow* title_row_; // Not used in material design.
views::ScrollView* scroller_; views::ScrollView* scroller_;
views::View* scroll_content_; views::View* scroll_content_;
views::ProgressBar* progress_bar_; views::ProgressBar* progress_bar_;
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
#include "ash/common/system/tray/tray_details_view.h" #include "ash/common/system/tray/tray_details_view.h"
#include "ash/common/ash_view_ids.h" #include "ash/common/ash_view_ids.h"
#include "ash/common/system/tray/hover_highlight_view.h"
#include "ash/common/system/tray/special_popup_row.h"
#include "ash/common/system/tray/system_tray.h" #include "ash/common/system/tray/system_tray.h"
#include "ash/common/system/tray/system_tray_item.h" #include "ash/common/system/tray/system_tray_item.h"
#include "ash/common/system/tray/tray_constants.h" #include "ash/common/system/tray/tray_constants.h"
...@@ -43,8 +41,6 @@ class TestDetailsView : public TrayDetailsView { ...@@ -43,8 +41,6 @@ class TestDetailsView : public TrayDetailsView {
return tray_popup_header_button_; return tray_popup_header_button_;
} }
void FocusTitleRow() { title_row()->content()->RequestFocus(); }
void CreateScrollerViews() { CreateScrollableList(); } void CreateScrollerViews() { CreateScrollableList(); }
private: private:
...@@ -99,19 +95,6 @@ class TrayDetailsViewTest : public AshTestBase { ...@@ -99,19 +95,6 @@ class TrayDetailsViewTest : public AshTestBase {
TrayDetailsViewTest() {} TrayDetailsViewTest() {}
~TrayDetailsViewTest() override {} ~TrayDetailsViewTest() override {}
HoverHighlightView* CreateAndShowHoverHighlightView() {
SystemTray* tray = GetPrimarySystemTray();
TestItem* test_item = new TestItem;
tray->AddTrayItem(base::WrapUnique(test_item));
tray->ShowDefaultView(BUBBLE_CREATE_NEW);
RunAllPendingInMessageLoop();
tray->ShowDetailedView(test_item, 0, true, BUBBLE_USE_EXISTING);
RunAllPendingInMessageLoop();
return static_cast<HoverHighlightView*>(
test_item->detailed_view()->title_row()->content());
}
TrayPopupHeaderButton* CreateAndShowTrayPopupHeaderButton() { TrayPopupHeaderButton* CreateAndShowTrayPopupHeaderButton() {
SystemTray* tray = GetPrimarySystemTray(); SystemTray* tray = GetPrimarySystemTray();
TestItem* test_item = new TestItem; TestItem* test_item = new TestItem;
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
<structure type="chrome_scaled_image" name="IDR_AURA_PHANTOM_WINDOW_TOP_RIGHT" file="common/phantom_window_top_right.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_PHANTOM_WINDOW_TOP_RIGHT" file="common/phantom_window_top_right.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_ACCESSIBILITY_DARK" file="cros/status/status_accessibility_dark.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_ACCESSIBILITY_DARK" file="cros/status/status_accessibility_dark.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_LESS" file="cros/status/status_less.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_LOCALE" file="cros/status/status_locale.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_LOCALE" file="cros/status/status_locale.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_NETWORK_CONTROLLED" file="cros/network/status_captive_portal_access.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_NETWORK_CONTROLLED" file="cros/network/status_captive_portal_access.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_NETWORK_FAILED" file="cros/network/status_network_failed.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_NETWORK_FAILED" file="cros/network/status_network_failed.png" />
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment