| 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 #ifndef ASH_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ | 5 #ifndef ASH_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ |
| 6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ | 6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/common/system/tray/special_popup_row.h" | 9 #include "ash/common/system/tray/special_popup_row.h" |
| 10 #include "ash/common/system/tray/view_click_listener.h" | 10 #include "ash/common/system/tray/view_click_listener.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "ui/views/controls/button/button.h" | 12 #include "ui/views/controls/button/button.h" |
| 13 #include "ui/views/view.h" | 13 #include "ui/views/view.h" |
| 14 | 14 |
| 15 namespace views { | 15 namespace views { |
| 16 class BoxLayout; |
| 16 class ScrollView; | 17 class ScrollView; |
| 17 class ProgressBar; | 18 class ProgressBar; |
| 18 } // namespace views | 19 } // namespace views |
| 19 | 20 |
| 20 namespace ash { | 21 namespace ash { |
| 21 namespace test { | 22 namespace test { |
| 22 class TrayDetailsViewTest; | 23 class TrayDetailsViewTest; |
| 23 } // namespace test | 24 } // namespace test |
| 24 | 25 |
| 25 class FixedSizedScrollView; | 26 class FixedSizedScrollView; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 42 void ButtonPressed(views::Button* sender, const ui::Event& event) final; | 43 void ButtonPressed(views::Button* sender, const ui::Event& event) final; |
| 43 | 44 |
| 44 SystemTrayItem* owner() { return owner_; } | 45 SystemTrayItem* owner() { return owner_; } |
| 45 SpecialPopupRow* title_row() { return title_row_; } | 46 SpecialPopupRow* title_row() { return title_row_; } |
| 46 FixedSizedScrollView* scroller() { return scroller_; } | 47 FixedSizedScrollView* scroller() { return scroller_; } |
| 47 views::View* scroll_content() { return scroll_content_; } | 48 views::View* scroll_content() { return scroll_content_; } |
| 48 | 49 |
| 49 protected: | 50 protected: |
| 50 // views::View: | 51 // views::View: |
| 51 void Layout() override; | 52 void Layout() override; |
| 53 int GetHeightForWidth(int width) const override; |
| 52 void OnPaintBorder(gfx::Canvas* canvas) override; | 54 void OnPaintBorder(gfx::Canvas* canvas) override; |
| 53 | 55 |
| 54 // Creates the row containing the back button and title. For material design | 56 // Creates the row containing the back button and title. For material design |
| 55 // this appears at the top of the view, for non-material design it appears | 57 // this appears at the top of the view, for non-material design it appears |
| 56 // at the bottom. | 58 // at the bottom. |
| 57 void CreateTitleRow(int string_id); | 59 void CreateTitleRow(int string_id); |
| 58 | 60 |
| 59 // Creates a scrollable list. The list has a border at the bottom if there is | 61 // Creates a scrollable list. The list has a border at the bottom if there is |
| 60 // any other view between the list and the footer row at the bottom. | 62 // any other view between the list and the footer row at the bottom. |
| 61 void CreateScrollableList(); | 63 void CreateScrollableList(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 83 | 85 |
| 84 // Creates and adds subclass-specific buttons to the title row. | 86 // Creates and adds subclass-specific buttons to the title row. |
| 85 virtual void CreateExtraTitleRowButtons(); | 87 virtual void CreateExtraTitleRowButtons(); |
| 86 | 88 |
| 87 // Transition to default view from details view. If |title_row_| has focus | 89 // Transition to default view from details view. If |title_row_| has focus |
| 88 // before transition, the default view should focus on the owner of this | 90 // before transition, the default view should focus on the owner of this |
| 89 // details view. | 91 // details view. |
| 90 void TransitionToDefaultView(); | 92 void TransitionToDefaultView(); |
| 91 | 93 |
| 92 SystemTrayItem* owner_; | 94 SystemTrayItem* owner_; |
| 95 views::BoxLayout* box_layout_; |
| 93 SpecialPopupRow* title_row_; | 96 SpecialPopupRow* title_row_; |
| 94 FixedSizedScrollView* scroller_; | 97 FixedSizedScrollView* scroller_; |
| 95 views::View* scroll_content_; | 98 views::View* scroll_content_; |
| 96 views::ProgressBar* progress_bar_; | 99 views::ProgressBar* progress_bar_; |
| 97 | 100 |
| 98 ScrollBorder* scroll_border_; // Weak reference | 101 ScrollBorder* scroll_border_; // Weak reference |
| 99 | 102 |
| 100 // The back button that appears in the material design title row. Not owned. | 103 // The back button that appears in the material design title row. Not owned. |
| 101 views::Button* back_button_; | 104 views::Button* back_button_; |
| 102 | 105 |
| 103 DISALLOW_COPY_AND_ASSIGN(TrayDetailsView); | 106 DISALLOW_COPY_AND_ASSIGN(TrayDetailsView); |
| 104 }; | 107 }; |
| 105 | 108 |
| 106 } // namespace ash | 109 } // namespace ash |
| 107 | 110 |
| 108 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ | 111 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ |
| OLD | NEW |