| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/translate/translate_bubble_controller.h" | 5 #import "chrome/browser/ui/cocoa/translate/translate_bubble_controller.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
| 10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 kRelatedControlVerticalSpacing; | 602 kRelatedControlVerticalSpacing; |
| 603 | 603 |
| 604 [sourceLanguageLabel setFrameOrigin:NSMakePoint( | 604 [sourceLanguageLabel setFrameOrigin:NSMakePoint( |
| 605 textLabelWidth - NSWidth([sourceLanguageLabel frame]), yPos + diffY)]; | 605 textLabelWidth - NSWidth([sourceLanguageLabel frame]), yPos + diffY)]; |
| 606 | 606 |
| 607 frame = [sourcePopUpButton frame]; | 607 frame = [sourcePopUpButton frame]; |
| 608 frame.origin = NSMakePoint(textLabelWidth, yPos); | 608 frame.origin = NSMakePoint(textLabelWidth, yPos); |
| 609 frame.size.width = NSWidth([targetPopUpButton frame]); | 609 frame.size.width = NSWidth([targetPopUpButton frame]); |
| 610 [sourcePopUpButton setFrame:frame]; | 610 [sourcePopUpButton setFrame:frame]; |
| 611 | 611 |
| 612 [view setFrameSize:NSMakeSize(kContentWidth, | 612 [view |
| 613 NSMaxY([sourcePopUpButton frame]))]; | 613 setFrameSize:NSMakeSize(kContentWidth, NSMaxY([sourcePopUpButton frame]) + |
| 614 kIconPadding)]; |
| 614 | 615 |
| 615 [self updateAdvancedView]; | 616 [self updateAdvancedView]; |
| 616 | 617 |
| 617 return view; | 618 return view; |
| 618 } | 619 } |
| 619 | 620 |
| 620 - (void)updateAdvancedView { | 621 - (void)updateAdvancedView { |
| 621 NSString* title; | 622 NSString* title; |
| 622 if (model_->IsPageTranslatedInCurrentLanguages()) | 623 if (model_->IsPageTranslatedInCurrentLanguages()) |
| 623 title = l10n_util::GetNSStringWithFixup(IDS_DONE); | 624 title = l10n_util::GetNSStringWithFixup(IDS_DONE); |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 // source or target language on the before translate view. | 879 // source or target language on the before translate view. |
| 879 - (BOOL)textView:(NSTextView*)aTextView | 880 - (BOOL)textView:(NSTextView*)aTextView |
| 880 clickedOnLink:(id)link | 881 clickedOnLink:(id)link |
| 881 atIndex:(NSUInteger)charIndex { | 882 atIndex:(NSUInteger)charIndex { |
| 882 translate::ReportUiAction(translate::ADVANCED_LINK_CLICKED); | 883 translate::ReportUiAction(translate::ADVANCED_LINK_CLICKED); |
| 883 [self switchView:TranslateBubbleModel::VIEW_STATE_ADVANCED]; | 884 [self switchView:TranslateBubbleModel::VIEW_STATE_ADVANCED]; |
| 884 return YES; | 885 return YES; |
| 885 } | 886 } |
| 886 | 887 |
| 887 @end | 888 @end |
| OLD | NEW |