Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Side by Side Diff: chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm

Issue 7713034: HostContentSettingsMap refactoring. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Code review comments. Threading fixes. Mac + win fixes. Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/content_settings/collected_cookies_mac.h" 5 #import "chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #import "base/mac/mac_util.h" 9 #import "base/mac/mac_util.h"
10 #include "base/sys_string_conversions.h" 10 #include "base/sys_string_conversions.h"
11 #include "chrome/browser/content_settings/cookie_settings.h"
11 #include "chrome/browser/content_settings/host_content_settings_map.h" 12 #include "chrome/browser/content_settings/host_content_settings_map.h"
12 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 13 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
13 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/ui/cocoa/constrained_window_mac.h" 15 #include "chrome/browser/ui/cocoa/constrained_window_mac.h"
15 #import "chrome/browser/ui/cocoa/content_settings/cookie_details_view_controller .h" 16 #import "chrome/browser/ui/cocoa/content_settings/cookie_details_view_controller .h"
16 #import "chrome/browser/ui/cocoa/vertical_gradient_view.h" 17 #import "chrome/browser/ui/cocoa/vertical_gradient_view.h"
17 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" 18 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h"
18 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 19 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
19 #include "chrome/common/chrome_notification_types.h" 20 #include "chrome/common/chrome_notification_types.h"
20 #include "content/browser/tab_contents/tab_contents.h" 21 #include "content/browser/tab_contents/tab_contents.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 [infoBar_ setGradient:bannerGradient]; 181 [infoBar_ setGradient:bannerGradient];
181 182
182 NSColor* bannerStrokeColor = 183 NSColor* bannerStrokeColor =
183 [NSColor colorWithCalibratedWhite:kBannerStrokeColor 184 [NSColor colorWithCalibratedWhite:kBannerStrokeColor
184 alpha:1.0]; 185 alpha:1.0];
185 [infoBar_ setStrokeColor:bannerStrokeColor]; 186 [infoBar_ setStrokeColor:bannerStrokeColor];
186 187
187 // Change the label of the blocked cookies part if necessary. 188 // Change the label of the blocked cookies part if necessary.
188 Profile* profile = 189 Profile* profile =
189 Profile::FromBrowserContext(tabContents_->browser_context()); 190 Profile::FromBrowserContext(tabContents_->browser_context());
190 if (profile->GetHostContentSettingsMap()->BlockThirdPartyCookies()) { 191 CookieSettings* cookie_settings =
192 CookieSettings::GetForProfile(profile);
193 if (cookie_settings->ShouldBlockThirdPartyCookies()) {
191 [blockedCookiesText_ setStringValue:l10n_util::GetNSString( 194 [blockedCookiesText_ setStringValue:l10n_util::GetNSString(
192 IDS_COLLECTED_COOKIES_BLOCKED_THIRD_PARTY_BLOCKING_ENABLED)]; 195 IDS_COLLECTED_COOKIES_BLOCKED_THIRD_PARTY_BLOCKING_ENABLED)];
193 CGFloat textDeltaY = [GTMUILocalizerAndLayoutTweaker 196 CGFloat textDeltaY = [GTMUILocalizerAndLayoutTweaker
194 sizeToFitFixedWidthTextField:blockedCookiesText_]; 197 sizeToFitFixedWidthTextField:blockedCookiesText_];
195 198
196 // Shrink the blocked cookies outline view. 199 // Shrink the blocked cookies outline view.
197 NSRect frame = [blockedScrollView_ frame]; 200 NSRect frame = [blockedScrollView_ frame];
198 frame.size.height -= textDeltaY; 201 frame.size.height -= textDeltaY;
199 [blockedScrollView_ setFrame:frame]; 202 [blockedScrollView_ setFrame:frame];
200 203
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 treeController = blockedTreeController_; 514 treeController = blockedTreeController_;
512 break; 515 break;
513 default: 516 default:
514 NOTREACHED(); 517 NOTREACHED();
515 return; 518 return;
516 } 519 }
517 [detailsViewController_ configureBindingsForTreeController:treeController]; 520 [detailsViewController_ configureBindingsForTreeController:treeController];
518 } 521 }
519 522
520 @end 523 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698