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/view.h" | 11 #include "views/view.h" |
12 | 12 |
13 namespace views { | 13 namespace views { |
14 class Label; | 14 class Label; |
15 } | 15 } |
16 | 16 |
17 class PageInfoBubbleView : public views::View, | 17 class PageInfoBubbleView : public views::View, |
18 public PageInfoModel::PageInfoModelObserver, | 18 public PageInfoModel::PageInfoModelObserver, |
19 public InfoBubbleDelegate { | 19 public InfoBubbleDelegate { |
20 public: | 20 public: |
21 PageInfoBubbleView(gfx::NativeWindow parent_window, | 21 PageInfoBubbleView(Profile* profile, |
22 Profile* profile, | |
23 const GURL& url, | 22 const GURL& url, |
24 const NavigationEntry::SSLStatus& ssl, | 23 const NavigationEntry::SSLStatus& ssl, |
25 bool show_history); | 24 bool show_history); |
26 virtual ~PageInfoBubbleView(); | 25 virtual ~PageInfoBubbleView(); |
27 | 26 |
28 // Show the certificate dialog. | |
29 void ShowCertDialog(); | |
30 | 27 |
31 void set_info_bubble(InfoBubble* info_bubble) { info_bubble_ = info_bubble; } | 28 void set_info_bubble(InfoBubble* info_bubble) { info_bubble_ = info_bubble; } |
32 | 29 |
33 // View methods: | 30 // View methods: |
34 virtual gfx::Size GetPreferredSize(); | 31 virtual gfx::Size GetPreferredSize(); |
35 | 32 |
36 // PageInfoModel::PageInfoModelObserver methods: | 33 // PageInfoModel::PageInfoModelObserver methods: |
37 virtual void ModelChanged(); | 34 virtual void ModelChanged(); |
38 | 35 |
39 // InfoBubbleDelegate methods: | 36 // InfoBubbleDelegate methods: |
40 virtual void InfoBubbleClosing(InfoBubble* info_bubble, | 37 virtual void InfoBubbleClosing(InfoBubble* info_bubble, |
41 bool closed_by_escape) {} | 38 bool closed_by_escape) {} |
42 virtual bool CloseOnEscape() { return true; } | 39 virtual bool CloseOnEscape() { return true; } |
43 virtual bool FadeInOnShow() { return false; } | 40 virtual bool FadeInOnShow() { return false; } |
44 virtual std::wstring accessible_name() { return L"PageInfoBubble"; } | 41 virtual std::wstring accessible_name() { return L"PageInfoBubble"; } |
45 | 42 |
46 private: | 43 private: |
47 // Layout the sections within the bubble. | 44 // Layout the sections within the bubble. |
48 void LayoutSections(); | 45 void LayoutSections(); |
49 | 46 |
50 // The parent window of the InfoBubble showing this view. | |
51 gfx::NativeWindow parent_window_; | |
52 | |
53 // The model providing the various section info. | 47 // The model providing the various section info. |
54 PageInfoModel model_; | 48 PageInfoModel model_; |
55 | 49 |
56 // The id of the certificate for this page. | 50 // The id of the certificate for this page. |
57 int cert_id_; | 51 int cert_id_; |
58 | 52 |
59 InfoBubble* info_bubble_; | 53 InfoBubble* info_bubble_; |
60 | 54 |
61 DISALLOW_COPY_AND_ASSIGN(PageInfoBubbleView); | 55 DISALLOW_COPY_AND_ASSIGN(PageInfoBubbleView); |
62 }; | 56 }; |
63 | 57 |
64 #endif // CHROME_BROWSER_VIEWS_PAGE_INFO_BUBBLE_VIEW_H_ | 58 #endif // CHROME_BROWSER_VIEWS_PAGE_INFO_BUBBLE_VIEW_H_ |
OLD | NEW |