| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 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 CHROME_BROWSER_UI_PANELS_ABOUT_PANEL_BUBBLE_H_ | |
| 6 #define CHROME_BROWSER_UI_PANELS_ABOUT_PANEL_BUBBLE_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/gtest_prod_util.h" | |
| 10 #include "chrome/browser/ui/views/bubble/bubble.h" | |
| 11 #include "views/controls/link_listener.h" | |
| 12 | |
| 13 class Browser; | |
| 14 class Extension; | |
| 15 namespace views { | |
| 16 class ImageView; | |
| 17 class Label; | |
| 18 class Link; | |
| 19 class Textfield; | |
| 20 } | |
| 21 | |
| 22 class AboutPanelBubble : public Bubble, | |
| 23 public BubbleDelegate { | |
| 24 public: | |
| 25 // Returns NULL if no extension can be found for |browser|. | |
| 26 static AboutPanelBubble* Show(views::Widget* parent, | |
| 27 const gfx::Rect& position_relative_to, | |
| 28 BubbleBorder::ArrowLocation arrow_location, | |
| 29 SkBitmap icon, | |
| 30 Browser* browser); | |
| 31 | |
| 32 private: | |
| 33 friend class PanelBrowserViewTest; | |
| 34 FRIEND_TEST_ALL_PREFIXES(PanelBrowserViewTest, AboutPanelBubble); | |
| 35 | |
| 36 class AboutPanelBubbleView : public views::View, | |
| 37 public views::LinkListener { | |
| 38 public: | |
| 39 AboutPanelBubbleView(SkBitmap icon, | |
| 40 Browser* browser, | |
| 41 const Extension* extension); | |
| 42 | |
| 43 private: | |
| 44 friend class PanelBrowserViewTest; | |
| 45 FRIEND_TEST_ALL_PREFIXES(PanelBrowserViewTest, AboutPanelBubble); | |
| 46 | |
| 47 virtual ~AboutPanelBubbleView() { } | |
| 48 | |
| 49 // Overridden from View: | |
| 50 virtual void Layout() OVERRIDE; | |
| 51 virtual gfx::Size GetPreferredSize() OVERRIDE; | |
| 52 | |
| 53 // Overridden from LinkListener: | |
| 54 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; | |
| 55 | |
| 56 views::ImageView* icon_; | |
| 57 views::Label* title_; | |
| 58 views::Label* install_date_; | |
| 59 views::Textfield* description_; | |
| 60 views::Link* uninstall_link_; | |
| 61 views::Link* report_abuse_link_; | |
| 62 | |
| 63 DISALLOW_COPY_AND_ASSIGN(AboutPanelBubbleView); | |
| 64 }; | |
| 65 | |
| 66 AboutPanelBubble(); | |
| 67 virtual ~AboutPanelBubble() { } | |
| 68 | |
| 69 // Overridden from BubbleDelegate: | |
| 70 virtual void BubbleClosing(Bubble* info_bubble, bool closed_by_escape) | |
| 71 OVERRIDE {} | |
| 72 virtual bool CloseOnEscape() OVERRIDE; | |
| 73 virtual bool FadeInOnShow() OVERRIDE; | |
| 74 virtual std::wstring accessible_name() OVERRIDE; | |
| 75 | |
| 76 DISALLOW_COPY_AND_ASSIGN(AboutPanelBubble); | |
| 77 }; | |
| 78 | |
| 79 #endif // CHROME_BROWSER_UI_PANELS_ABOUT_PANEL_BUBBLE_H_ | |
| OLD | NEW |