Home | History | Annotate | Download | only in tray
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef ASH_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_
      6 #define ASH_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_
      7 
      8 #include "ash/system/tray/special_popup_row.h"
      9 #include "ui/views/view.h"
     10 
     11 namespace views {
     12 class ScrollView;
     13 }
     14 
     15 namespace ash {
     16 
     17 class SystemTrayItem;
     18 
     19 namespace internal {
     20 
     21 class FixedSizedScrollView;
     22 class ScrollBorder;
     23 class ViewClickListener;
     24 
     25 class TrayDetailsView : public views::View {
     26  public:
     27   explicit TrayDetailsView(SystemTrayItem* owner);
     28   virtual ~TrayDetailsView();
     29 
     30   // Creates a row with special highlighting etc. This is typically the
     31   // bottom-most row in the popup.
     32   void CreateSpecialRow(int string_id, ViewClickListener* listener);
     33 
     34   // Creates a scrollable list. The list has a border at the bottom if there is
     35   // any other view between the list and the footer row at the bottom.
     36   void CreateScrollableList();
     37 
     38   // Adds a separator in scrollable list.
     39   void AddScrollSeparator();
     40 
     41   // Removes (and destroys) all child views.
     42   void Reset();
     43 
     44   SystemTrayItem* owner() const { return owner_; }
     45   SpecialPopupRow* footer() const { return footer_; }
     46   FixedSizedScrollView* scroller() const { return scroller_; }
     47   views::View* scroll_content() const { return scroll_content_; }
     48 
     49  protected:
     50   // Overridden from views::View.
     51   virtual void Layout() OVERRIDE;
     52   virtual void OnPaintBorder(gfx::Canvas* canvas) OVERRIDE;
     53 
     54  private:
     55   SystemTrayItem* owner_;
     56   SpecialPopupRow* footer_;
     57   FixedSizedScrollView* scroller_;
     58   views::View* scroll_content_;
     59   ScrollBorder* scroll_border_;
     60 
     61   DISALLOW_COPY_AND_ASSIGN(TrayDetailsView);
     62 };
     63 
     64 }  // namespace internal
     65 }  // namespace ash
     66 
     67 #endif  // ASH_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_
     68