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

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

Issue 7497030: PluginList cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix crash Created 9 years, 4 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
« no previous file with comments | « chrome/browser/plugin_updater.cc ('k') | chrome/browser/ui/cocoa/drag_util.mm » ('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/plugin_updater.h"
13 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" 12 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h"
14 #import "chrome/browser/ui/cocoa/hyperlink_button_cell.h" 13 #import "chrome/browser/ui/cocoa/hyperlink_button_cell.h"
15 #import "chrome/browser/ui/cocoa/info_bubble_view.h" 14 #import "chrome/browser/ui/cocoa/info_bubble_view.h"
16 #import "chrome/browser/ui/cocoa/l10n_util.h" 15 #import "chrome/browser/ui/cocoa/l10n_util.h"
17 #include "grit/generated_resources.h" 16 #include "grit/generated_resources.h"
18 #include "skia/ext/skia_utils_mac.h" 17 #include "skia/ext/skia_utils_mac.h"
19 #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" 18 #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h"
20 #include "ui/base/l10n/l10n_util.h" 19 #include "ui/base/l10n/l10n_util.h"
21 #include "webkit/glue/plugins/plugin_list.h" 20 #include "webkit/plugins/npapi/plugin_list.h"
22 21
23 namespace { 22 namespace {
24 23
25 // 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.
26 const int kAllowTag = 1; 25 const int kAllowTag = 1;
27 26
28 // 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.
29 const int kBlockTag = 2; 28 const int kBlockTag = 2;
30 29
31 // Height of one link in the popup list. 30 // Height of one link in the popup list.
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 int delta = NSMinY([titleLabel_ frame]) - 235 int delta = NSMinY([titleLabel_ frame]) -
237 NSMinY([blockedResourcesField_ frame]); 236 NSMinY([blockedResourcesField_ frame]);
238 [blockedResourcesField_ removeFromSuperview]; 237 [blockedResourcesField_ removeFromSuperview];
239 NSRect frame = [[self window] frame]; 238 NSRect frame = [[self window] frame];
240 frame.size.height -= delta; 239 frame.size.height -= delta;
241 [[self window] setFrame:frame display:NO]; 240 [[self window] setFrame:frame display:NO];
242 } else { 241 } else {
243 for (std::set<std::string>::iterator it = plugins.begin(); 242 for (std::set<std::string>::iterator it = plugins.begin();
244 it != plugins.end(); ++it) { 243 it != plugins.end(); ++it) {
245 NSString* name = SysUTF16ToNSString( 244 NSString* name = SysUTF16ToNSString(
246 NPAPI::PluginList::Singleton()->GetPluginGroupName(*it)); 245 webkit::npapi::PluginList::Singleton()->GetPluginGroupName(*it));
247 if ([name length] == 0) 246 if ([name length] == 0)
248 name = base::SysUTF8ToNSString(*it); 247 name = base::SysUTF8ToNSString(*it);
249 [pluginArray addObject:name]; 248 [pluginArray addObject:name];
250 } 249 }
251 [blockedResourcesField_ 250 [blockedResourcesField_
252 setStringValue:[pluginArray componentsJoinedByString:@"\n"]]; 251 setStringValue:[pluginArray componentsJoinedByString:@"\n"]];
253 [GTMUILocalizerAndLayoutTweaker 252 [GTMUILocalizerAndLayoutTweaker
254 sizeToFitFixedWidthTextField:blockedResourcesField_]; 253 sizeToFitFixedWidthTextField:blockedResourcesField_];
255 } 254 }
256 } 255 }
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 480
482 - (IBAction)manageBlocking:(id)sender { 481 - (IBAction)manageBlocking:(id)sender {
483 contentSettingBubbleModel_->OnManageLinkClicked(); 482 contentSettingBubbleModel_->OnManageLinkClicked();
484 } 483 }
485 484
486 - (IBAction)closeBubble:(id)sender { 485 - (IBAction)closeBubble:(id)sender {
487 [self close]; 486 [self close];
488 } 487 }
489 488
490 @end // ContentSettingBubbleController 489 @end // ContentSettingBubbleController
OLDNEW
« no previous file with comments | « chrome/browser/plugin_updater.cc ('k') | chrome/browser/ui/cocoa/drag_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698