| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 - (void)handleSourceLanguagePopUpButtonSelectedItemChanged:(id)sender; | 106 - (void)handleSourceLanguagePopUpButtonSelectedItemChanged:(id)sender; |
| 107 - (void)handleTargetLanguagePopUpButtonSelectedItemChanged:(id)sender; | 107 - (void)handleTargetLanguagePopUpButtonSelectedItemChanged:(id)sender; |
| 108 | 108 |
| 109 @end | 109 @end |
| 110 | 110 |
| 111 @implementation TranslateBubbleController | 111 @implementation TranslateBubbleController |
| 112 | 112 |
| 113 @synthesize webContents = webContents_; | 113 @synthesize webContents = webContents_; |
| 114 | 114 |
| 115 - (id)initWithParentWindow:(BrowserWindowController*)controller | 115 - (id)initWithParentWindow:(BrowserWindowController*)controller |
| 116 model:(scoped_ptr<TranslateBubbleModel>)model | 116 model:(std::unique_ptr<TranslateBubbleModel>)model |
| 117 webContents:(content::WebContents*)webContents { | 117 webContents:(content::WebContents*)webContents { |
| 118 NSWindow* parentWindow = [controller window]; | 118 NSWindow* parentWindow = [controller window]; |
| 119 | 119 |
| 120 // Use an arbitrary size; it will be changed in performLayout. | 120 // Use an arbitrary size; it will be changed in performLayout. |
| 121 NSRect contentRect = ui::kWindowSizeDeterminedLater; | 121 NSRect contentRect = ui::kWindowSizeDeterminedLater; |
| 122 base::scoped_nsobject<InfoBubbleWindow> window( | 122 base::scoped_nsobject<InfoBubbleWindow> window( |
| 123 [[InfoBubbleWindow alloc] initWithContentRect:contentRect | 123 [[InfoBubbleWindow alloc] initWithContentRect:contentRect |
| 124 styleMask:NSBorderlessWindowMask | 124 styleMask:NSBorderlessWindowMask |
| 125 backing:NSBackingStoreBuffered | 125 backing:NSBackingStoreBuffered |
| 126 defer:NO]); | 126 defer:NO]); |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 [self updateAdvancedView]; | 653 [self updateAdvancedView]; |
| 654 } | 654 } |
| 655 | 655 |
| 656 - (void)handleTargetLanguagePopUpButtonSelectedItemChanged:(id)sender { | 656 - (void)handleTargetLanguagePopUpButtonSelectedItemChanged:(id)sender { |
| 657 NSPopUpButton* button = base::mac::ObjCCastStrict<NSPopUpButton>(sender); | 657 NSPopUpButton* button = base::mac::ObjCCastStrict<NSPopUpButton>(sender); |
| 658 model_->UpdateTargetLanguageIndex([button indexOfSelectedItem]); | 658 model_->UpdateTargetLanguageIndex([button indexOfSelectedItem]); |
| 659 [self updateAdvancedView]; | 659 [self updateAdvancedView]; |
| 660 } | 660 } |
| 661 | 661 |
| 662 @end | 662 @end |
| OLD | NEW |