| 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 |
| 11 #include "base/i18n/rtl.h" | 11 #include "base/i18n/rtl.h" |
| 12 #include "base/mac/bind_objc_block.h" | 12 #include "base/mac/bind_objc_block.h" |
| 13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
| 14 #include "base/strings/string_number_conversions.h" | |
| 15 #include "base/strings/sys_string_conversions.h" | 14 #include "base/strings/sys_string_conversions.h" |
| 16 #import "chrome/browser/certificate_viewer.h" | 15 #import "chrome/browser/certificate_viewer.h" |
| 17 #include "chrome/browser/devtools/devtools_toggle_action.h" | 16 #include "chrome/browser/devtools/devtools_toggle_action.h" |
| 18 #include "chrome/browser/devtools/devtools_window.h" | 17 #include "chrome/browser/devtools/devtools_window.h" |
| 19 #include "chrome/browser/infobars/infobar_service.h" | 18 #include "chrome/browser/infobars/infobar_service.h" |
| 20 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
| 21 #include "chrome/browser/ui/browser_dialogs.h" | 20 #include "chrome/browser/ui/browser_dialogs.h" |
| 22 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 21 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 23 #import "chrome/browser/ui/cocoa/info_bubble_view.h" | 22 #import "chrome/browser/ui/cocoa/info_bubble_view.h" |
| 24 #import "chrome/browser/ui/cocoa/info_bubble_window.h" | 23 #import "chrome/browser/ui/cocoa/info_bubble_window.h" |
| (...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 935 // that sometimes permissions may not be displayed at all, so it's | 934 // that sometimes permissions may not be displayed at all, so it's |
| 936 // incorrect to check they are set before the cookie info. | 935 // incorrect to check they are set before the cookie info. |
| 937 | 936 |
| 938 // |cookieInfoList| should only ever have 2 items: first- and third-party | 937 // |cookieInfoList| should only ever have 2 items: first- and third-party |
| 939 // cookies. | 938 // cookies. |
| 940 DCHECK_EQ(cookieInfoList.size(), 2u); | 939 DCHECK_EQ(cookieInfoList.size(), 2u); |
| 941 base::string16 firstPartyLabelText; | 940 base::string16 firstPartyLabelText; |
| 942 base::string16 thirdPartyLabelText; | 941 base::string16 thirdPartyLabelText; |
| 943 for (const auto& i : cookieInfoList) { | 942 for (const auto& i : cookieInfoList) { |
| 944 if (i.is_first_party) { | 943 if (i.is_first_party) { |
| 945 firstPartyLabelText = | 944 firstPartyLabelText = l10n_util::GetPluralStringFUTF16( |
| 946 l10n_util::GetStringFUTF16(IDS_WEBSITE_SETTINGS_FIRST_PARTY_SITE_DATA, | 945 IDS_WEBSITE_SETTINGS_FIRST_PARTY_SITE_DATA, i.allowed); |
| 947 base::IntToString16(i.allowed)); | |
| 948 } else { | 946 } else { |
| 949 thirdPartyLabelText = | 947 thirdPartyLabelText = l10n_util::GetPluralStringFUTF16( |
| 950 l10n_util::GetStringFUTF16(IDS_WEBSITE_SETTINGS_THIRD_PARTY_SITE_DATA, | 948 IDS_WEBSITE_SETTINGS_THIRD_PARTY_SITE_DATA, i.allowed); |
| 951 base::IntToString16(i.allowed)); | |
| 952 } | 949 } |
| 953 } | 950 } |
| 954 | 951 |
| 955 base::string16 sectionTitle = | 952 base::string16 sectionTitle = |
| 956 l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_TITLE_SITE_DATA); | 953 l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_TITLE_SITE_DATA); |
| 957 bool isRTL = base::i18n::RIGHT_TO_LEFT == | 954 bool isRTL = base::i18n::RIGHT_TO_LEFT == |
| 958 base::i18n::GetStringDirection(firstPartyLabelText); | 955 base::i18n::GetStringDirection(firstPartyLabelText); |
| 959 | 956 |
| 960 [cookiesView_ setSubviews:[NSArray array]]; | 957 [cookiesView_ setSubviews:[NSArray array]]; |
| 961 NSPoint controlOrigin = NSMakePoint(kFramePadding, 0); | 958 NSPoint controlOrigin = NSMakePoint(kFramePadding, 0); |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1176 void WebsiteSettingsUIBridge::SetPermissionInfo( | 1173 void WebsiteSettingsUIBridge::SetPermissionInfo( |
| 1177 const PermissionInfoList& permission_info_list, | 1174 const PermissionInfoList& permission_info_list, |
| 1178 const ChosenObjectInfoList& chosen_object_info_list) { | 1175 const ChosenObjectInfoList& chosen_object_info_list) { |
| 1179 [bubble_controller_ setPermissionInfo:permission_info_list | 1176 [bubble_controller_ setPermissionInfo:permission_info_list |
| 1180 andChosenObjects:chosen_object_info_list]; | 1177 andChosenObjects:chosen_object_info_list]; |
| 1181 } | 1178 } |
| 1182 | 1179 |
| 1183 void WebsiteSettingsUIBridge::SetSelectedTab(TabId tab_id) { | 1180 void WebsiteSettingsUIBridge::SetSelectedTab(TabId tab_id) { |
| 1184 // TODO(lgarron): Remove this from the interface. (crbug.com/571533) | 1181 // TODO(lgarron): Remove this from the interface. (crbug.com/571533) |
| 1185 } | 1182 } |
| OLD | NEW |