Update path of checkdeps to buildtools checkout
[chromium-blink-merge.git] / ui / message_center / views / message_center_button_bar.h
blob524a01f2c59d0d4b640d89fd8dd5504fa22a7e7b
1 // Copyright 2013 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 UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_BUTTON_BAR_H_
6 #define UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_BUTTON_BAR_H_
8 #include "ui/views/controls/button/button.h"
9 #include "ui/views/controls/button/image_button.h"
10 #include "ui/views/view.h"
12 namespace views {
13 class Label;
16 namespace message_center {
18 class ButtonBarSettingsLabel;
19 class MessageCenter;
20 class MessageCenterTray;
21 class MessageCenterView;
22 class NotificationCenterButton;
23 class NotifierSettingsProvider;
25 // MessageCenterButtonBar is the class that shows the content outside the main
26 // notification area - the label (or NotifierGroup switcher) and the buttons.
27 class MessageCenterButtonBar : public views::View,
28 public views::ButtonListener {
29 public:
30 MessageCenterButtonBar(MessageCenterView* message_center_view,
31 MessageCenter* message_center,
32 NotifierSettingsProvider* notifier_settings_provider,
33 bool settings_initially_visible);
34 virtual ~MessageCenterButtonBar();
36 // Enables or disables all of the buttons in the center. This is used to
37 // prevent user clicks during the close-all animation.
38 virtual void SetAllButtonsEnabled(bool enabled);
40 // Sometimes we shouldn't see the close-all button.
41 void SetCloseAllButtonEnabled(bool enabled);
43 // Sometimes we shouldn't see the back arrow (not in settings).
44 void SetBackArrowVisible(bool visible);
46 private:
47 // Updates the layout manager which can have differing configuration
48 // depending on the visibilty of different parts of the button bar.
49 void ViewVisibilityChanged();
51 // Overridden from views::View:
52 virtual void ChildVisibilityChanged(views::View* child) OVERRIDE;
54 // Overridden from views::ButtonListener:
55 virtual void ButtonPressed(views::Button* sender,
56 const ui::Event& event) OVERRIDE;
58 MessageCenterView* message_center_view() const {
59 return message_center_view_;
61 MessageCenter* message_center() const { return message_center_; }
63 MessageCenterView* message_center_view_; // Weak reference.
64 MessageCenter* message_center_; // Weak reference.
66 // |close_bubble_button_| closes the message center bubble. This is required
67 // for desktop Linux because the status icon doesn't toggle the bubble, and
68 // close-on-deactivation is off. This is a tentative solution. Once pkotwicz
69 // Fixes the problem of focus-follow-mouse, close-on-deactivation will be
70 // back and this field will be removed. See crbug.com/319516.
71 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
72 views::ImageButton* close_bubble_button_;
73 #endif
75 // Sub-views of the button bar.
76 NotificationCenterButton* title_arrow_;
77 views::Label* notification_label_;
78 views::View* button_container_;
79 NotificationCenterButton* close_all_button_;
80 NotificationCenterButton* settings_button_;
81 NotificationCenterButton* quiet_mode_button_;
83 DISALLOW_COPY_AND_ASSIGN(MessageCenterButtonBar);
86 } // namespace message_center
88 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_BUTTON_BAR_H_