| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/mac/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 NSTextField* identityField_; | 37 NSTextField* identityField_; |
| 38 | 38 |
| 39 // Displays the security summary for the page (private/not private/etc.). | 39 // Displays the security summary for the page (private/not private/etc.). |
| 40 NSTextField* securitySummaryField_; | 40 NSTextField* securitySummaryField_; |
| 41 | 41 |
| 42 // The link button for opening security details for the page. This is the | 42 // The link button for opening security details for the page. This is the |
| 43 // DevTools Security panel for most users, but may be the certificate viewer | 43 // DevTools Security panel for most users, but may be the certificate viewer |
| 44 // for enterprise users with DevTools disabled. | 44 // for enterprise users with DevTools disabled. |
| 45 NSButton* securityDetailsButton_; | 45 NSButton* securityDetailsButton_; |
| 46 | 46 |
| 47 // URL of the page for which the bubble is shown. |
| 48 GURL url_; |
| 49 |
| 47 // Whether DevTools is disabled for the relevant profile. | 50 // Whether DevTools is disabled for the relevant profile. |
| 48 BOOL isDevToolsDisabled_; | 51 BOOL isDevToolsDisabled_; |
| 49 | 52 |
| 50 // The ID of the server certificate from the identity info. This should | 53 // The ID of the server certificate from the identity info. This should |
| 51 // always be non-zero on a cryptographic connection, and 0 otherwise. | 54 // always be non-zero on a cryptographic connection, and 0 otherwise. |
| 52 int certificateId_; | 55 int certificateId_; |
| 53 | 56 |
| 54 // The link button for revoking certificate decisions. | 57 // The link button for revoking certificate decisions. |
| 55 NSButton* resetDecisionsButton_; | 58 NSButton* resetDecisionsButton_; |
| 56 | 59 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 74 | 77 |
| 75 // The UI translates user actions to specific events and forwards them to the | 78 // The UI translates user actions to specific events and forwards them to the |
| 76 // |presenter_|. The |presenter_| handles these events and updates the UI. | 79 // |presenter_|. The |presenter_| handles these events and updates the UI. |
| 77 std::unique_ptr<WebsiteSettings> presenter_; | 80 std::unique_ptr<WebsiteSettings> presenter_; |
| 78 | 81 |
| 79 // Bridge which implements the WebsiteSettingsUI interface and forwards | 82 // Bridge which implements the WebsiteSettingsUI interface and forwards |
| 80 // methods on to this class. | 83 // methods on to this class. |
| 81 std::unique_ptr<WebsiteSettingsUIBridge> bridge_; | 84 std::unique_ptr<WebsiteSettingsUIBridge> bridge_; |
| 82 } | 85 } |
| 83 | 86 |
| 84 enum BubbleType { | |
| 85 WEB_PAGE, // Bubble for web URLs | |
| 86 INTERNAL_PAGE, // For chrome: URLs | |
| 87 EXTENSION_PAGE, // For chrome-extension: URLs | |
| 88 }; | |
| 89 | |
| 90 // Designated initializer. The controller will release itself when the bubble | 87 // Designated initializer. The controller will release itself when the bubble |
| 91 // is closed. |parentWindow| cannot be nil. |webContents| may be nil for | 88 // is closed. |parentWindow| cannot be nil. |webContents| may be nil for |
| 92 // testing purposes. | 89 // testing purposes. |
| 93 - (id)initWithParentWindow:(NSWindow*)parentWindow | 90 - (id)initWithParentWindow:(NSWindow*)parentWindow |
| 94 websiteSettingsUIBridge:(WebsiteSettingsUIBridge*)bridge | 91 websiteSettingsUIBridge:(WebsiteSettingsUIBridge*)bridge |
| 95 webContents:(content::WebContents*)webContents | 92 webContents:(content::WebContents*)webContents |
| 96 bubbleType:(BubbleType)bubbleType | 93 url:(const GURL&)url |
| 97 isDevToolsDisabled:(BOOL)isDevToolsDisabled; | 94 isDevToolsDisabled:(BOOL)isDevToolsDisabled; |
| 98 | 95 |
| 99 // Return the default width of the window. It may be wider to fit the content. | 96 // Return the default width of the window. It may be wider to fit the content. |
| 100 // This may be overriden by a subclass for testing purposes. | 97 // This may be overriden by a subclass for testing purposes. |
| 101 - (CGFloat)defaultWindowWidth; | 98 - (CGFloat)defaultWindowWidth; |
| 102 | 99 |
| 103 @end | 100 @end |
| 104 | 101 |
| 105 // Provides a bridge between the WebSettingsUI C++ interface and the Cocoa | 102 // Provides a bridge between the WebSettingsUI C++ interface and the Cocoa |
| 106 // implementation in WebsiteSettingsBubbleController. | 103 // implementation in WebsiteSettingsBubbleController. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 | 137 |
| 141 private: | 138 private: |
| 142 // The WebContents the bubble UI is attached to. | 139 // The WebContents the bubble UI is attached to. |
| 143 content::WebContents* web_contents_; | 140 content::WebContents* web_contents_; |
| 144 | 141 |
| 145 // The Cocoa controller for the bubble UI. | 142 // The Cocoa controller for the bubble UI. |
| 146 WebsiteSettingsBubbleController* bubble_controller_; | 143 WebsiteSettingsBubbleController* bubble_controller_; |
| 147 | 144 |
| 148 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsUIBridge); | 145 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsUIBridge); |
| 149 }; | 146 }; |
| OLD | NEW |