| Index: chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.mm
|
| diff --git a/chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.mm b/chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.mm
|
| index 2651dd3c7fe988c9e007c64ef9d64b2126c4e5ee..f8baba4528cf72d3d48bcbb1870bca2ef00d6f01 100644
|
| --- a/chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.mm
|
| +++ b/chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.mm
|
| @@ -18,7 +18,7 @@
|
| #import "chrome/browser/ui/cocoa/base_bubble_controller.h"
|
| #import "chrome/browser/ui/cocoa/browser_window_controller.h"
|
| #import "chrome/browser/ui/cocoa/browser_window_utils.h"
|
| -#import "chrome/browser/ui/cocoa/chooser_content_view_cocoa.h"
|
| +#import "chrome/browser/ui/cocoa/device_chooser_content_view_cocoa.h"
|
| #import "chrome/browser/ui/cocoa/info_bubble_view.h"
|
| #import "chrome/browser/ui/cocoa/info_bubble_window.h"
|
| #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
|
| @@ -40,7 +40,8 @@ std::unique_ptr<BubbleUi> ChooserBubbleDelegate::BuildBubbleUi() {
|
| ChooserBubbleUiCocoa* bridge_; // Weak.
|
| bool buttonPressed_;
|
|
|
| - base::scoped_nsobject<ChooserContentViewCocoa> chooserContentView_;
|
| + base::scoped_nsobject<DeviceChooserContentViewCocoa>
|
| + deviceChooserContentView_;
|
| NSTableView* tableView_; // Weak.
|
| NSButton* connectButton_; // Weak.
|
| NSButton* cancelButton_; // Weak.
|
| @@ -116,13 +117,13 @@ std::unique_ptr<BubbleUi> ChooserBubbleDelegate::BuildBubbleUi() {
|
| object:[self getExpectedParentWindow]];
|
|
|
| base::string16 chooserTitle = chooserController->GetTitle();
|
| - chooserContentView_.reset([[ChooserContentViewCocoa alloc]
|
| + deviceChooserContentView_.reset([[DeviceChooserContentViewCocoa alloc]
|
| initWithChooserTitle:base::SysUTF16ToNSString(chooserTitle)
|
| chooserController:std::move(chooserController)]);
|
|
|
| - tableView_ = [chooserContentView_ tableView];
|
| - connectButton_ = [chooserContentView_ connectButton];
|
| - cancelButton_ = [chooserContentView_ cancelButton];
|
| + tableView_ = [deviceChooserContentView_ tableView];
|
| + connectButton_ = [deviceChooserContentView_ connectButton];
|
| + cancelButton_ = [deviceChooserContentView_ cancelButton];
|
|
|
| [connectButton_ setTarget:self];
|
| [connectButton_ setAction:@selector(onConnect:)];
|
| @@ -131,7 +132,7 @@ std::unique_ptr<BubbleUi> ChooserBubbleDelegate::BuildBubbleUi() {
|
| [tableView_ setDelegate:self];
|
| [tableView_ setDataSource:self];
|
|
|
| - [[[self window] contentView] addSubview:chooserContentView_.get()];
|
| + [[[self window] contentView] addSubview:deviceChooserContentView_.get()];
|
| }
|
|
|
| return self;
|
| @@ -143,7 +144,7 @@ std::unique_ptr<BubbleUi> ChooserBubbleDelegate::BuildBubbleUi() {
|
| name:NSWindowDidMoveNotification
|
| object:nil];
|
| if (!buttonPressed_)
|
| - [chooserContentView_ close];
|
| + [deviceChooserContentView_ close];
|
| bridge_->OnBubbleClosing();
|
| [super windowWillClose:notification];
|
| }
|
| @@ -163,7 +164,7 @@ std::unique_ptr<BubbleUi> ChooserBubbleDelegate::BuildBubbleUi() {
|
|
|
| - (void)show {
|
| NSRect bubbleFrame =
|
| - [[self window] frameRectForContentRect:[chooserContentView_ frame]];
|
| + [[self window] frameRectForContentRect:[deviceChooserContentView_ frame]];
|
| if ([[self window] isVisible]) {
|
| // Unfortunately, calling -setFrame followed by -setFrameOrigin (called
|
| // within -setAnchorPoint) causes flickering. Avoid the flickering by
|
| @@ -185,13 +186,13 @@ std::unique_ptr<BubbleUi> ChooserBubbleDelegate::BuildBubbleUi() {
|
| }
|
|
|
| - (NSInteger)numberOfRowsInTableView:(NSTableView*)tableView {
|
| - return [chooserContentView_ numberOfOptions];
|
| + return [deviceChooserContentView_ numberOfOptions];
|
| }
|
|
|
| - (NSView*)tableView:(NSTableView*)tableView
|
| viewForTableColumn:(NSTableColumn*)tableColumn
|
| row:(NSInteger)row {
|
| - return [chooserContentView_ createTableRowView:row].autorelease();
|
| + return [deviceChooserContentView_ createTableRowView:row].autorelease();
|
| }
|
|
|
| - (BOOL)tableView:(NSTableView*)aTableView
|
| @@ -201,21 +202,21 @@ std::unique_ptr<BubbleUi> ChooserBubbleDelegate::BuildBubbleUi() {
|
| }
|
|
|
| - (CGFloat)tableView:(NSTableView*)tableView heightOfRow:(NSInteger)row {
|
| - return [chooserContentView_ tableRowViewHeight:row];
|
| + return [deviceChooserContentView_ tableRowViewHeight:row];
|
| }
|
|
|
| - (void)updateTableView {
|
| - [chooserContentView_ updateTableView];
|
| + [deviceChooserContentView_ updateTableView];
|
| }
|
|
|
| - (void)tableViewSelectionDidChange:(NSNotification*)aNotification {
|
| - [chooserContentView_ updateContentRowColor];
|
| + [deviceChooserContentView_ updateContentRowColor];
|
| [connectButton_ setEnabled:[tableView_ numberOfSelectedRows] > 0];
|
| }
|
|
|
| // Selection changes (while the mouse button is still down).
|
| - (void)tableViewSelectionIsChanging:(NSNotification*)aNotification {
|
| - [chooserContentView_ updateContentRowColor];
|
| + [deviceChooserContentView_ updateContentRowColor];
|
| [connectButton_ setEnabled:[tableView_ numberOfSelectedRows] > 0];
|
| }
|
|
|
| @@ -272,7 +273,7 @@ std::unique_ptr<BubbleUi> ChooserBubbleDelegate::BuildBubbleUi() {
|
|
|
| - (void)onConnect:(id)sender {
|
| buttonPressed_ = true;
|
| - [chooserContentView_ accept];
|
| + [deviceChooserContentView_ accept];
|
| if (self.bubbleReference)
|
| self.bubbleReference->CloseBubble(BUBBLE_CLOSE_ACCEPTED);
|
| [self close];
|
| @@ -280,7 +281,7 @@ std::unique_ptr<BubbleUi> ChooserBubbleDelegate::BuildBubbleUi() {
|
|
|
| - (void)onCancel:(id)sender {
|
| buttonPressed_ = true;
|
| - [chooserContentView_ cancel];
|
| + [deviceChooserContentView_ cancel];
|
| if (self.bubbleReference)
|
| self.bubbleReference->CloseBubble(BUBBLE_CLOSE_CANCELED);
|
| [self close];
|
|
|