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

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

Issue 8493026: Revert r108760 / reland r108744, r108753 w/ fix (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename plugin list accessor to plugin_list() Created 9 years, 1 month 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
« no previous file with comments | « chrome/browser/plugin_prefs.cc ('k') | chrome/browser/ui/gtk/content_setting_bubble_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/content_setting_bubble_cocoa.h " 5 #import "chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.h "
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/sys_string_conversions.h" 9 #include "base/sys_string_conversions.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
11 #include "chrome/browser/content_settings/host_content_settings_map.h" 11 #include "chrome/browser/content_settings/host_content_settings_map.h"
12 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" 12 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h"
13 #import "chrome/browser/ui/cocoa/hyperlink_button_cell.h" 13 #import "chrome/browser/ui/cocoa/hyperlink_button_cell.h"
14 #import "chrome/browser/ui/cocoa/info_bubble_view.h" 14 #import "chrome/browser/ui/cocoa/info_bubble_view.h"
15 #import "chrome/browser/ui/cocoa/l10n_util.h" 15 #import "chrome/browser/ui/cocoa/l10n_util.h"
16 #include "content/browser/plugin_service.h"
16 #include "grit/generated_resources.h" 17 #include "grit/generated_resources.h"
17 #include "skia/ext/skia_utils_mac.h" 18 #include "skia/ext/skia_utils_mac.h"
18 #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" 19 #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h"
19 #include "ui/base/l10n/l10n_util.h" 20 #include "ui/base/l10n/l10n_util.h"
20 #include "webkit/plugins/npapi/plugin_list.h"
21 21
22 namespace { 22 namespace {
23 23
24 // Must match the tag of the unblock radio button in the xib files. 24 // Must match the tag of the unblock radio button in the xib files.
25 const int kAllowTag = 1; 25 const int kAllowTag = 1;
26 26
27 // Must match the tag of the block radio button in the xib files. 27 // Must match the tag of the block radio button in the xib files.
28 const int kBlockTag = 2; 28 const int kBlockTag = 2;
29 29
30 // Height of one link in the popup list. 30 // Height of one link in the popup list.
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 int delta = NSMinY([titleLabel_ frame]) - 238 int delta = NSMinY([titleLabel_ frame]) -
239 NSMinY([blockedResourcesField_ frame]); 239 NSMinY([blockedResourcesField_ frame]);
240 [blockedResourcesField_ removeFromSuperview]; 240 [blockedResourcesField_ removeFromSuperview];
241 NSRect frame = [[self window] frame]; 241 NSRect frame = [[self window] frame];
242 frame.size.height -= delta; 242 frame.size.height -= delta;
243 [[self window] setFrame:frame display:NO]; 243 [[self window] setFrame:frame display:NO];
244 } else { 244 } else {
245 for (std::set<std::string>::iterator it = plugins.begin(); 245 for (std::set<std::string>::iterator it = plugins.begin();
246 it != plugins.end(); ++it) { 246 it != plugins.end(); ++it) {
247 NSString* name = SysUTF16ToNSString( 247 NSString* name = SysUTF16ToNSString(
248 webkit::npapi::PluginList::Singleton()->GetPluginGroupName(*it)); 248 PluginService::GetInstance()->GetPluginGroupName(*it));
249 if ([name length] == 0) 249 if ([name length] == 0)
250 name = base::SysUTF8ToNSString(*it); 250 name = base::SysUTF8ToNSString(*it);
251 [pluginArray addObject:name]; 251 [pluginArray addObject:name];
252 } 252 }
253 [blockedResourcesField_ 253 [blockedResourcesField_
254 setStringValue:[pluginArray componentsJoinedByString:@"\n"]]; 254 setStringValue:[pluginArray componentsJoinedByString:@"\n"]];
255 [GTMUILocalizerAndLayoutTweaker 255 [GTMUILocalizerAndLayoutTweaker
256 sizeToFitFixedWidthTextField:blockedResourcesField_]; 256 sizeToFitFixedWidthTextField:blockedResourcesField_];
257 } 257 }
258 } 258 }
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 483
484 - (IBAction)manageBlocking:(id)sender { 484 - (IBAction)manageBlocking:(id)sender {
485 contentSettingBubbleModel_->OnManageLinkClicked(); 485 contentSettingBubbleModel_->OnManageLinkClicked();
486 } 486 }
487 487
488 - (IBAction)closeBubble:(id)sender { 488 - (IBAction)closeBubble:(id)sender {
489 [self close]; 489 [self close];
490 } 490 }
491 491
492 @end // ContentSettingBubbleController 492 @end // ContentSettingBubbleController
OLDNEW
« no previous file with comments | « chrome/browser/plugin_prefs.cc ('k') | chrome/browser/ui/gtk/content_setting_bubble_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698