| 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_COCOA_PAGE_INFO_WINDOW_MAC_H_ | 5 #ifndef CHROME_BROWSER_COCOA_PAGE_INFO_WINDOW_MAC_H_ |
| 6 #define CHROME_BROWSER_COCOA_PAGE_INFO_WINDOW_MAC_H_ | 6 #define CHROME_BROWSER_COCOA_PAGE_INFO_WINDOW_MAC_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
| 10 | 10 |
| 11 #include "base/scoped_nsobject.h" | 11 #include "base/scoped_nsobject.h" |
| 12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
| 13 #include "chrome/browser/page_info_model.h" | 13 #include "chrome/browser/page_info_model.h" |
| 14 #include "chrome/browser/page_info_window.h" | 14 #include "chrome/browser/page_info_window.h" |
| 15 | 15 |
| 16 class Profile; | 16 class Profile; |
| 17 @class PageInfoWindowController; | 17 @class PageInfoWindowController; |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | |
| 21 class PageInfoWindowMacTest; | 20 class PageInfoWindowMacTest; |
| 22 | |
| 23 }; | 21 }; |
| 24 | 22 |
| 25 // This bridge is responsible for getting information from the cross-platform | 23 // This bridge is responsible for getting information from the cross-platform |
| 26 // model and dynamically creating the contents of the window. The controller is | 24 // model and dynamically creating the contents of the window. The controller is |
| 27 // responsible for managing the window's memory and user events (pressing on | 25 // responsible for managing the window's memory and user events (pressing on |
| 28 // the Show Certificate button). | 26 // the Show Certificate button). |
| 29 class PageInfoWindowMac : public PageInfoModel::PageInfoModelObserver { | 27 class PageInfoWindowMac : public PageInfoModel::PageInfoModelObserver { |
| 30 public: | 28 public: |
| 31 virtual ~PageInfoWindowMac(); | 29 virtual ~PageInfoWindowMac(); |
| 32 | 30 |
| 33 // Creates and shows the page info. | 31 // Used to create the page info window; called from the cross-platform |
| 34 static void ShowPageInfo(Profile* profile, | 32 // function. |
| 33 static void ShowPageInfo(gfx::NativeWindow parent, |
| 34 Profile* profile, |
| 35 const GURL& url, | 35 const GURL& url, |
| 36 const NavigationEntry::SSLStatus& ssl, | 36 const NavigationEntry::SSLStatus& ssl, |
| 37 bool show_history); | 37 bool show_history); |
| 38 | 38 |
| 39 // Shows various information for the specified certificate in a new dialog. | 39 // Shows various information for the specified certificate in a new dialog. |
| 40 // The argument is ignored here and we use the |cert_id_| member that was | 40 // The argument is ignored here and we use the |cert_id_| member that was |
| 41 // passed to us in Init(). | 41 // passed to us in Init(). |
| 42 virtual void ShowCertDialog(int); | 42 virtual void ShowCertDialog(int); |
| 43 | 43 |
| 44 // PageInfoModelObserver implementation. | 44 // PageInfoModelObserver implementation. |
| 45 virtual void ModelChanged(); | 45 virtual void ModelChanged(); |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 friend class ::PageInfoWindowMacTest; | 48 friend class ::PageInfoWindowMacTest; |
| 49 | 49 |
| 50 // Private constructor, called by ShowPageInfo(). | 50 // Constructor; private. Called by ShowPageInfo(). |
| 51 PageInfoWindowMac(PageInfoWindowController* controller, | 51 PageInfoWindowMac(PageInfoWindowController* controller, |
| 52 Profile* profile, | 52 Profile* profile, |
| 53 const GURL& url, | 53 const GURL& url, |
| 54 const NavigationEntry::SSLStatus& ssl, | 54 const NavigationEntry::SSLStatus& ssl, |
| 55 bool show_history); | 55 bool show_history); |
| 56 | 56 |
| 57 // Testing constructor. DO NOT USE. | 57 // Testing constructor. DO NOT USE. |
| 58 PageInfoWindowMac(PageInfoWindowController* controller, | 58 PageInfoWindowMac(PageInfoWindowController* controller, |
| 59 PageInfoModel* model); | 59 PageInfoModel* model); |
| 60 | 60 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 77 scoped_nsobject<NSImage> good_image_; | 77 scoped_nsobject<NSImage> good_image_; |
| 78 scoped_nsobject<NSImage> bad_image_; | 78 scoped_nsobject<NSImage> bad_image_; |
| 79 | 79 |
| 80 // The certificate ID for the page, 0 if the page is not over HTTPS. | 80 // The certificate ID for the page, 0 if the page is not over HTTPS. |
| 81 int cert_id_; | 81 int cert_id_; |
| 82 | 82 |
| 83 DISALLOW_COPY_AND_ASSIGN(PageInfoWindowMac); | 83 DISALLOW_COPY_AND_ASSIGN(PageInfoWindowMac); |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 #endif // CHROME_BROWSER_COCOA_PAGE_INFO_WINDOW_MAC_H_ | 86 #endif // CHROME_BROWSER_COCOA_PAGE_INFO_WINDOW_MAC_H_ |
| OLD | NEW |