| 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/page_info/page_info_bubble_controller.h" | 5 #import "chrome/browser/ui/cocoa/page_info/page_info_bubble_controller.h" |
| 6 | 6 |
| 7 #import <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 | 10 |
| (...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1021 // cookies. | 1021 // cookies. |
| 1022 DCHECK_EQ(cookieInfoList.size(), 2u); | 1022 DCHECK_EQ(cookieInfoList.size(), 2u); |
| 1023 | 1023 |
| 1024 int totalAllowed = 0; | 1024 int totalAllowed = 0; |
| 1025 for (const auto& i : cookieInfoList) { | 1025 for (const auto& i : cookieInfoList) { |
| 1026 totalAllowed += i.allowed; | 1026 totalAllowed += i.allowed; |
| 1027 } | 1027 } |
| 1028 base::string16 label_text = | 1028 base::string16 label_text = |
| 1029 l10n_util::GetPluralStringFUTF16(IDS_PAGE_INFO_NUM_COOKIES, totalAllowed); | 1029 l10n_util::GetPluralStringFUTF16(IDS_PAGE_INFO_NUM_COOKIES, totalAllowed); |
| 1030 | 1030 |
| 1031 base::string16 sectionTitle = | |
| 1032 l10n_util::GetStringUTF16(IDS_PAGE_INFO_TITLE_SITE_DATA); | |
| 1033 bool isRTL = base::i18n::IsRTL(); | 1031 bool isRTL = base::i18n::IsRTL(); |
| 1034 | 1032 |
| 1035 [cookiesView_ setSubviews:[NSArray array]]; | 1033 [cookiesView_ setSubviews:[NSArray array]]; |
| 1036 NSPoint controlOrigin = NSMakePoint(kSectionHorizontalPadding, 0); | 1034 NSPoint controlOrigin = NSMakePoint(kSectionHorizontalPadding, 0); |
| 1037 | 1035 |
| 1038 CGFloat viewWidth = NSWidth([cookiesView_ frame]); | 1036 CGFloat viewWidth = NSWidth([cookiesView_ frame]); |
| 1039 | 1037 |
| 1040 // Reset X for the cookie image. | 1038 // Reset X for the cookie image. |
| 1041 if (isRTL) { | 1039 if (isRTL) { |
| 1042 controlOrigin.x = viewWidth - kPermissionImageSize - | 1040 controlOrigin.x = viewWidth - kPermissionImageSize - |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1216 void PageInfoUIBridge::SetCookieInfo(const CookieInfoList& cookie_info_list) { | 1214 void PageInfoUIBridge::SetCookieInfo(const CookieInfoList& cookie_info_list) { |
| 1217 [bubble_controller_ setCookieInfo:cookie_info_list]; | 1215 [bubble_controller_ setCookieInfo:cookie_info_list]; |
| 1218 } | 1216 } |
| 1219 | 1217 |
| 1220 void PageInfoUIBridge::SetPermissionInfo( | 1218 void PageInfoUIBridge::SetPermissionInfo( |
| 1221 const PermissionInfoList& permission_info_list, | 1219 const PermissionInfoList& permission_info_list, |
| 1222 ChosenObjectInfoList chosen_object_info_list) { | 1220 ChosenObjectInfoList chosen_object_info_list) { |
| 1223 [bubble_controller_ setPermissionInfo:permission_info_list | 1221 [bubble_controller_ setPermissionInfo:permission_info_list |
| 1224 andChosenObjects:std::move(chosen_object_info_list)]; | 1222 andChosenObjects:std::move(chosen_object_info_list)]; |
| 1225 } | 1223 } |
| OLD | NEW |