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