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.
5 #ifndef ASH_SYSTEM_TRAY_TRAY_ITEM_MORE_H_
6 #define ASH_SYSTEM_TRAY_TRAY_ITEM_MORE_H_
8 #include "ash/system/tray/actionable_view.h"
9 #include "ui/views/view.h"
20 // A view with a chevron ('>') on the right edge. Clicking on the view brings up
21 // the detailed view of the tray-item that owns it.
22 class TrayItemMore
: public ActionableView
{
24 TrayItemMore(SystemTrayItem
* owner
, bool show_more
);
25 virtual ~TrayItemMore();
27 SystemTrayItem
* owner() const { return owner_
; }
29 void SetLabel(const base::string16
& label
);
30 void SetImage(const gfx::ImageSkia
* image_skia
);
31 void SetAccessibleName(const base::string16
& name
);
34 // Replaces the default icon (on the left of the label), and allows a custom
35 // view to be placed there. Once the default icon is replaced, |SetImage|
36 // should never be called.
37 void ReplaceIcon(views::View
* view
);
40 // Overridden from ActionableView.
41 virtual bool PerformAction(const ui::Event
& event
) OVERRIDE
;
43 // Overridden from views::View.
44 virtual void Layout() OVERRIDE
;
45 virtual void GetAccessibleState(ui::AXViewState
* state
) OVERRIDE
;
47 SystemTrayItem
* owner_
;
48 // True if |more_| should be shown.
50 views::ImageView
* icon_
;
52 views::ImageView
* more_
;
53 base::string16 accessible_name_
;
55 DISALLOW_COPY_AND_ASSIGN(TrayItemMore
);
60 #endif // ASH_SYSTEM_TRAY_TRAY_ITEM_MORE_H_