OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_setting_bubble_cocoa.h" | 5 #import "chrome/browser/ui/cocoa/content_setting_bubble_cocoa.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 if (plugins.empty()) { | 235 if (plugins.empty()) { |
236 int delta = NSMinY([titleLabel_ frame]) - | 236 int delta = NSMinY([titleLabel_ frame]) - |
237 NSMinY([blockedResourcesField_ frame]); | 237 NSMinY([blockedResourcesField_ frame]); |
238 [blockedResourcesField_ removeFromSuperview]; | 238 [blockedResourcesField_ removeFromSuperview]; |
239 NSRect frame = [[self window] frame]; | 239 NSRect frame = [[self window] frame]; |
240 frame.size.height -= delta; | 240 frame.size.height -= delta; |
241 [[self window] setFrame:frame display:NO]; | 241 [[self window] setFrame:frame display:NO]; |
242 } else { | 242 } else { |
243 for (std::set<std::string>::iterator it = plugins.begin(); | 243 for (std::set<std::string>::iterator it = plugins.begin(); |
244 it != plugins.end(); ++it) { | 244 it != plugins.end(); ++it) { |
245 NSString* name; | 245 NSString* name = SysUTF16ToNSString( |
246 NPAPI::PluginList::PluginMap groups; | 246 NPAPI::PluginList::Singleton()->GetPluginGroupName(*it)); |
247 NPAPI::PluginList::Singleton()->GetPluginGroups(false, &groups); | 247 if ([name length] == 0) |
248 if (groups.find(*it) != groups.end()) | |
249 name = base::SysUTF16ToNSString(groups[*it]->GetGroupName()); | |
250 else | |
251 name = base::SysUTF8ToNSString(*it); | 248 name = base::SysUTF8ToNSString(*it); |
252 [pluginArray addObject:name]; | 249 [pluginArray addObject:name]; |
253 } | 250 } |
254 [blockedResourcesField_ | 251 [blockedResourcesField_ |
255 setStringValue:[pluginArray componentsJoinedByString:@"\n"]]; | 252 setStringValue:[pluginArray componentsJoinedByString:@"\n"]]; |
256 [GTMUILocalizerAndLayoutTweaker | 253 [GTMUILocalizerAndLayoutTweaker |
257 sizeToFitFixedWidthTextField:blockedResourcesField_]; | 254 sizeToFitFixedWidthTextField:blockedResourcesField_]; |
258 } | 255 } |
259 } | 256 } |
260 | 257 |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 DCHECK(i != popupLinks_.end()); | 474 DCHECK(i != popupLinks_.end()); |
478 contentSettingBubbleModel_->OnPopupClicked(i->second); | 475 contentSettingBubbleModel_->OnPopupClicked(i->second); |
479 } | 476 } |
480 | 477 |
481 - (void)clearGeolocationForCurrentHost:(id)sender { | 478 - (void)clearGeolocationForCurrentHost:(id)sender { |
482 contentSettingBubbleModel_->OnClearLinkClicked(); | 479 contentSettingBubbleModel_->OnClearLinkClicked(); |
483 [self close]; | 480 [self close]; |
484 } | 481 } |
485 | 482 |
486 @end // ContentSettingBubbleController | 483 @end // ContentSettingBubbleController |
OLD | NEW |