OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_VIEWS_PAGE_INFO_BUBBLE_VIEW_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_PAGE_INFO_BUBBLE_VIEW_H_ |
6 #define CHROME_BROWSER_VIEWS_PAGE_INFO_BUBBLE_VIEW_H_ | 6 #define CHROME_BROWSER_VIEWS_PAGE_INFO_BUBBLE_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/page_info_model.h" | 9 #include "chrome/browser/page_info_model.h" |
10 #include "chrome/browser/views/info_bubble.h" | 10 #include "chrome/browser/views/info_bubble.h" |
| 11 #include "views/controls/link.h" |
11 #include "views/view.h" | 12 #include "views/view.h" |
12 | 13 |
13 namespace views { | 14 namespace views { |
14 class Label; | 15 class Label; |
15 } | 16 } |
16 | 17 |
17 class PageInfoBubbleView : public views::View, | 18 class PageInfoBubbleView : public views::View, |
18 public PageInfoModel::PageInfoModelObserver, | 19 public PageInfoModel::PageInfoModelObserver, |
19 public InfoBubbleDelegate { | 20 public InfoBubbleDelegate, |
| 21 public views::LinkController { |
20 public: | 22 public: |
21 PageInfoBubbleView(gfx::NativeWindow parent_window, | 23 PageInfoBubbleView(gfx::NativeWindow parent_window, |
22 Profile* profile, | 24 Profile* profile, |
23 const GURL& url, | 25 const GURL& url, |
24 const NavigationEntry::SSLStatus& ssl, | 26 const NavigationEntry::SSLStatus& ssl, |
25 bool show_history); | 27 bool show_history); |
26 virtual ~PageInfoBubbleView(); | 28 virtual ~PageInfoBubbleView(); |
27 | 29 |
28 // Show the certificate dialog. | 30 // Show the certificate dialog. |
29 void ShowCertDialog(); | 31 void ShowCertDialog(); |
30 | 32 |
31 void set_info_bubble(InfoBubble* info_bubble) { info_bubble_ = info_bubble; } | 33 void set_info_bubble(InfoBubble* info_bubble) { info_bubble_ = info_bubble; } |
32 | 34 |
33 // View methods: | 35 // View methods: |
34 virtual gfx::Size GetPreferredSize(); | 36 virtual gfx::Size GetPreferredSize(); |
35 | 37 |
36 // PageInfoModel::PageInfoModelObserver methods: | 38 // PageInfoModel::PageInfoModelObserver methods: |
37 virtual void ModelChanged(); | 39 virtual void ModelChanged(); |
38 | 40 |
39 // InfoBubbleDelegate methods: | 41 // InfoBubbleDelegate methods: |
40 virtual void InfoBubbleClosing(InfoBubble* info_bubble, | 42 virtual void InfoBubbleClosing(InfoBubble* info_bubble, |
41 bool closed_by_escape) {} | 43 bool closed_by_escape) {} |
42 virtual bool CloseOnEscape() { return true; } | 44 virtual bool CloseOnEscape() { return true; } |
43 virtual bool FadeInOnShow() { return false; } | 45 virtual bool FadeInOnShow() { return false; } |
44 virtual std::wstring accessible_name() { return L"PageInfoBubble"; } | 46 virtual std::wstring accessible_name() { return L"PageInfoBubble"; } |
45 | 47 |
| 48 // LinkController methods: |
| 49 virtual void LinkActivated(views::Link* source, int event_flags); |
| 50 |
46 private: | 51 private: |
47 // Layout the sections within the bubble. | 52 // Layout the sections within the bubble. |
48 void LayoutSections(); | 53 void LayoutSections(); |
49 | 54 |
50 // The model providing the various section info. | 55 // The model providing the various section info. |
51 PageInfoModel model_; | 56 PageInfoModel model_; |
52 | 57 |
53 // The parent window of the InfoBubble showing this view. | 58 // The parent window of the InfoBubble showing this view. |
54 gfx::NativeWindow parent_window_; | 59 gfx::NativeWindow parent_window_; |
55 | 60 |
56 // The id of the certificate for this page. | 61 // The id of the certificate for this page. |
57 int cert_id_; | 62 int cert_id_; |
58 | 63 |
59 InfoBubble* info_bubble_; | 64 InfoBubble* info_bubble_; |
60 | 65 |
| 66 // The Help Center link at the bottom of the bubble. |
| 67 views::Link* help_center_link_; |
| 68 |
61 DISALLOW_COPY_AND_ASSIGN(PageInfoBubbleView); | 69 DISALLOW_COPY_AND_ASSIGN(PageInfoBubbleView); |
62 }; | 70 }; |
63 | 71 |
64 #endif // CHROME_BROWSER_VIEWS_PAGE_INFO_BUBBLE_VIEW_H_ | 72 #endif // CHROME_BROWSER_VIEWS_PAGE_INFO_BUBBLE_VIEW_H_ |
OLD | NEW |