| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 2 * NSMinX([loadButton_ frame]); | 735 2 * NSMinX([loadButton_ frame]); |
| 736 if (NSWidth(windowFrame) < widthNeeded) { | 736 if (NSWidth(windowFrame) < widthNeeded) { |
| 737 windowFrame.size.width = widthNeeded; | 737 windowFrame.size.width = widthNeeded; |
| 738 [[self window] setFrame:windowFrame display:NO]; | 738 [[self window] setFrame:windowFrame display:NO]; |
| 739 } | 739 } |
| 740 } | 740 } |
| 741 | 741 |
| 742 - (void)initManageDoneButtons { | 742 - (void)initManageDoneButtons { |
| 743 const ContentSettingBubbleModel::BubbleContent& content = | 743 const ContentSettingBubbleModel::BubbleContent& content = |
| 744 contentSettingBubbleModel_->bubble_content(); | 744 contentSettingBubbleModel_->bubble_content(); |
| 745 [manageButton_ setTitle:base::SysUTF8ToNSString(content.manage_link)]; | 745 [manageButton_ setTitle:base::SysUTF8ToNSString(content.manage_text)]; |
| 746 [GTMUILocalizerAndLayoutTweaker sizeToFitView:[manageButton_ superview]]; | 746 [GTMUILocalizerAndLayoutTweaker sizeToFitView:[manageButton_ superview]]; |
| 747 | 747 |
| 748 CGFloat actualWidth = NSWidth([[[self window] contentView] frame]); | 748 CGFloat actualWidth = NSWidth([[[self window] contentView] frame]); |
| 749 CGFloat requiredWidth = NSMaxX([manageButton_ frame]) + kManageDonePadding + | 749 CGFloat requiredWidth = NSMaxX([manageButton_ frame]) + kManageDonePadding + |
| 750 NSWidth([[doneButton_ superview] frame]) - NSMinX([doneButton_ frame]); | 750 NSWidth([[doneButton_ superview] frame]) - NSMinX([doneButton_ frame]); |
| 751 if (requiredWidth <= actualWidth || !doneButton_ || !manageButton_) | 751 if (requiredWidth <= actualWidth || !doneButton_ || !manageButton_) |
| 752 return; | 752 return; |
| 753 | 753 |
| 754 // Resize window, autoresizing takes care of the rest. | 754 // Resize window, autoresizing takes care of the rest. |
| 755 NSSize size = NSMakeSize(requiredWidth - actualWidth, 0); | 755 NSSize size = NSMakeSize(requiredWidth - actualWidth, 0); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 button, base::SysUTF16ToNSString(it->second->model->GetLabelAt(index))); | 858 button, base::SysUTF16ToNSString(it->second->model->GetLabelAt(index))); |
| 859 | 859 |
| 860 it->second->model->ExecuteCommand(index, 0); | 860 it->second->model->ExecuteCommand(index, 0); |
| 861 } | 861 } |
| 862 | 862 |
| 863 - (content_setting_bubble::MediaMenuPartsMap*)mediaMenus { | 863 - (content_setting_bubble::MediaMenuPartsMap*)mediaMenus { |
| 864 return &mediaMenus_; | 864 return &mediaMenus_; |
| 865 } | 865 } |
| 866 | 866 |
| 867 @end // ContentSettingBubbleController | 867 @end // ContentSettingBubbleController |
| OLD | NEW |