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