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