diff options
author | dimich@chromium.org <dimich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-13 09:03:12 +0000 |
---|---|---|
committer | dimich@chromium.org <dimich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-13 09:03:12 +0000 |
commit | a3b599fd931049507213b1265f80a46f5b46267b (patch) | |
tree | 3f1bfe9d3d2fff47463723b5a7ecc45749b67b5f /ui/message_center/views/notification_button.h | |
parent | d0c709d668f0a935f933c3a11fc55041261e443b (diff) | |
download | chromium_src-a3b599fd931049507213b1265f80a46f5b46267b.zip chromium_src-a3b599fd931049507213b1265f80a46f5b46267b.tar.gz chromium_src-a3b599fd931049507213b1265f80a46f5b46267b.tar.bz2 |
Adding GroupView. Moving NotificationButton and ProportionalImageView
out into their own files (no code change for them, just move)
BUG=320827
Review URL: https://codereview.chromium.org/86083002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240559 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/message_center/views/notification_button.h')
-rw-r--r-- | ui/message_center/views/notification_button.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/ui/message_center/views/notification_button.h b/ui/message_center/views/notification_button.h new file mode 100644 index 0000000..7d3c52ce --- /dev/null +++ b/ui/message_center/views/notification_button.h @@ -0,0 +1,49 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_BUTTON_H_ +#define UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_BUTTON_H_ + +#include "ui/gfx/image/image_skia.h" +#include "ui/views/controls/button/custom_button.h" +#include "ui/views/painter.h" +#include "ui/views/view.h" + +namespace views { +class ImageView; +class Label; +} + +namespace message_center { + +// NotificationButtons render the action buttons of notifications. +class NotificationButton : public views::CustomButton { + public: + NotificationButton(views::ButtonListener* listener); + virtual ~NotificationButton(); + + void SetIcon(const gfx::ImageSkia& icon); + void SetTitle(const string16& title); + + // Overridden from views::View: + virtual gfx::Size GetPreferredSize() OVERRIDE; + virtual int GetHeightForWidth(int width) OVERRIDE; + virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; + virtual void OnFocus() OVERRIDE; + virtual void OnBlur() OVERRIDE; + + // Overridden from views::CustomButton: + virtual void StateChanged() OVERRIDE; + + private: + views::ImageView* icon_; + views::Label* title_; + scoped_ptr<views::Painter> focus_painter_; + + DISALLOW_COPY_AND_ASSIGN(NotificationButton); +}; + +} // namespace message_center + +#endif // UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_BUTTON_H_ |