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 "chrome/browser/ui/cocoa/website_settings/website_settings_bubble_contro
ller.h" | 5 #import "chrome/browser/ui/cocoa/website_settings/website_settings_bubble_contro
ller.h" |
6 | 6 |
7 #import <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" | 51 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" |
52 #include "ui/resources/grit/ui_resources.h" | 52 #include "ui/resources/grit/ui_resources.h" |
53 | 53 |
54 using ChosenObjectInfoPtr = | 54 using ChosenObjectInfoPtr = |
55 std::unique_ptr<WebsiteSettingsUI::ChosenObjectInfo>; | 55 std::unique_ptr<WebsiteSettingsUI::ChosenObjectInfo>; |
56 using ChosenObjectDeleteCallback = | 56 using ChosenObjectDeleteCallback = |
57 base::Callback<void(const WebsiteSettingsUI::ChosenObjectInfo&)>; | 57 base::Callback<void(const WebsiteSettingsUI::ChosenObjectInfo&)>; |
58 | 58 |
59 namespace { | 59 namespace { |
60 | 60 |
61 /**************** General ****************/ | 61 // General --------------------------------------------------------------------- |
62 | 62 |
63 // The default width of the window, in view coordinates. It may be larger to | 63 // The default width of the window, in view coordinates. It may be larger to |
64 // fit the content. | 64 // fit the content. |
65 const CGFloat kDefaultWindowWidth = 320; | 65 const CGFloat kDefaultWindowWidth = 320; |
66 | 66 |
67 // Padding around each section | 67 // Padding around each section |
68 const CGFloat kSectionVerticalPadding = 20; | 68 const CGFloat kSectionVerticalPadding = 20; |
69 const CGFloat kSectionHorizontalPadding = 16; | 69 const CGFloat kSectionHorizontalPadding = 16; |
70 | 70 |
71 // Links are buttons with invisible padding, so we need to move them back to | 71 // Links are buttons with invisible padding, so we need to move them back to |
72 // align with other text. | 72 // align with other text. |
73 const CGFloat kLinkButtonXAdjustment = 1; | 73 const CGFloat kLinkButtonXAdjustment = 1; |
74 | 74 |
75 /**************** Security Section ****************/ | 75 // Security Section ------------------------------------------------------------ |
76 | 76 |
77 // Spacing between security summary, security details, and cert decisions text. | 77 // Spacing between security summary, security details, and cert decisions text. |
78 const CGFloat kSecurityParagraphSpacing = 12; | 78 const CGFloat kSecurityParagraphSpacing = 12; |
79 | 79 |
80 /**************** Site Settings Section ****************/ | 80 // Site Settings Section ------------------------------------------------------- |
81 | 81 |
82 // Square size of the permission images. | 82 // Square size of the permission images. |
83 const CGFloat kPermissionImageSize = 16; | 83 const CGFloat kPermissionImageSize = 16; |
84 | 84 |
85 // Spacing between a permission image and the text. | 85 // Spacing between a permission image and the text. |
86 const CGFloat kPermissionImageSpacing = 6; | 86 const CGFloat kPermissionImageSpacing = 6; |
87 | 87 |
88 // Square size of the permission delete button image. | 88 // Square size of the permission delete button image. |
89 const CGFloat kPermissionDeleteImageSize = 16; | 89 const CGFloat kPermissionDeleteImageSize = 16; |
90 | 90 |
91 // The spacing between individual permissions. | 91 // The spacing between individual permissions. |
92 const CGFloat kPermissionsVerticalSpacing = 16; | 92 const CGFloat kPermissionsVerticalSpacing = 16; |
93 | 93 |
94 // Amount to lower each permission icon to align the icon baseline with the | 94 // Amount to lower each permission icon to align the icon baseline with the |
95 // label text. | 95 // label text. |
96 const CGFloat kPermissionIconYAdjustment = 1; | 96 const CGFloat kPermissionIconYAdjustment = 1; |
97 | 97 |
98 // Amount to lower each permission popup button to make its text align with the | 98 // Amount to lower each permission popup button to make its text align with the |
99 // permission label. | 99 // permission label. |
100 const CGFloat kPermissionPopupButtonYAdjustment = 3; | 100 const CGFloat kPermissionPopupButtonYAdjustment = 3; |
101 | 101 |
102 /**************** Internal Page Bubble ****************/ | 102 // Internal Page Bubble -------------------------------------------------------- |
103 | 103 |
104 // Padding between the window frame and content for the internal page bubble. | 104 // Padding between the window frame and content for the internal page bubble. |
105 const CGFloat kInternalPageFramePadding = 10; | 105 const CGFloat kInternalPageFramePadding = 10; |
106 | 106 |
107 // Spacing between the image and text for internal pages. | 107 // Spacing between the image and text for internal pages. |
108 const CGFloat kInternalPageImageSpacing = 10; | 108 const CGFloat kInternalPageImageSpacing = 10; |
109 | 109 |
110 /********************************/ | 110 // ----------------------------------------------------------------------------- |
111 | 111 |
112 // NOTE: This assumes that there will never be more than one website settings | 112 // NOTE: This assumes that there will never be more than one website settings |
113 // popup shown, and that the one that is shown is associated with the current | 113 // popup shown, and that the one that is shown is associated with the current |
114 // window. This matches the behaviour in views: see WebsiteSettingsPopupView. | 114 // window. This matches the behaviour in views: see WebsiteSettingsPopupView. |
115 bool g_is_popup_showing = false; | 115 bool g_is_popup_showing = false; |
116 | 116 |
117 // Takes in the parent window, which should be a BrowserWindow, and gets the | 117 // Takes in the parent window, which should be a BrowserWindow, and gets the |
118 // proper anchor point for the bubble. The returned point is in screen | 118 // proper anchor point for the bubble. The returned point is in screen |
119 // coordinates. | 119 // coordinates. |
120 NSPoint AnchorPointForWindow(NSWindow* parent) { | 120 NSPoint AnchorPointForWindow(NSWindow* parent) { |
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1191 void WebsiteSettingsUIBridge::SetPermissionInfo( | 1191 void WebsiteSettingsUIBridge::SetPermissionInfo( |
1192 const PermissionInfoList& permission_info_list, | 1192 const PermissionInfoList& permission_info_list, |
1193 const ChosenObjectInfoList& chosen_object_info_list) { | 1193 const ChosenObjectInfoList& chosen_object_info_list) { |
1194 [bubble_controller_ setPermissionInfo:permission_info_list | 1194 [bubble_controller_ setPermissionInfo:permission_info_list |
1195 andChosenObjects:chosen_object_info_list]; | 1195 andChosenObjects:chosen_object_info_list]; |
1196 } | 1196 } |
1197 | 1197 |
1198 void WebsiteSettingsUIBridge::SetSelectedTab(TabId tab_id) { | 1198 void WebsiteSettingsUIBridge::SetSelectedTab(TabId tab_id) { |
1199 // TODO(lgarron): Remove this from the interface. (crbug.com/571533) | 1199 // TODO(lgarron): Remove this from the interface. (crbug.com/571533) |
1200 } | 1200 } |
OLD | NEW |