| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/website_settings/chooser_bubble_ui_cocoa.h" | 5 #import "chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <cmath> | 10 #include <cmath> |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 bubbleFrame.origin = currentWindowFrame.origin; | 323 bubbleFrame.origin = currentWindowFrame.origin; |
| 324 bubbleFrame.origin.y = bubbleFrame.origin.y + | 324 bubbleFrame.origin.y = bubbleFrame.origin.y + |
| 325 currentWindowFrame.size.height - | 325 currentWindowFrame.size.height - |
| 326 bubbleFrame.size.height; | 326 bubbleFrame.size.height; |
| 327 [[self window] setFrame:bubbleFrame display:YES]; | 327 [[self window] setFrame:bubbleFrame display:YES]; |
| 328 } else { | 328 } else { |
| 329 [[self window] setFrame:bubbleFrame display:NO]; | 329 [[self window] setFrame:bubbleFrame display:NO]; |
| 330 [self setAnchorPoint:[self getExpectedAnchorPoint]]; | 330 [self setAnchorPoint:[self getExpectedAnchorPoint]]; |
| 331 [self showWindow:nil]; | 331 [self showWindow:nil]; |
| 332 [[self window] makeFirstResponder:nil]; | 332 [[self window] makeFirstResponder:nil]; |
| 333 [[self window] setInitialFirstResponder:tableView_.get()]; | 333 [[self window] setInitialFirstResponder:connectButton_.get()]; |
| 334 } | 334 } |
| 335 } | 335 } |
| 336 | 336 |
| 337 - (NSInteger)numberOfRowsInTableView:(NSTableView*)tableView { | 337 - (NSInteger)numberOfRowsInTableView:(NSTableView*)tableView { |
| 338 // When there are no devices, the table contains a message saying there are | 338 // When there are no devices, the table contains a message saying there are |
| 339 // no devices, so the number of rows is always at least 1. | 339 // no devices, so the number of rows is always at least 1. |
| 340 return std::max( | 340 return std::max( |
| 341 static_cast<NSInteger>(chooserBubbleController_->NumOptions()), | 341 static_cast<NSInteger>(chooserBubbleController_->NumOptions()), |
| 342 static_cast<NSInteger>(1)); | 342 static_cast<NSInteger>(1)); |
| 343 } | 343 } |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 [chooser_bubble_ui_controller_ onOptionAdded:static_cast<NSInteger>(index)]; | 576 [chooser_bubble_ui_controller_ onOptionAdded:static_cast<NSInteger>(index)]; |
| 577 } | 577 } |
| 578 | 578 |
| 579 void ChooserBubbleUiCocoa::OnOptionRemoved(size_t index) { | 579 void ChooserBubbleUiCocoa::OnOptionRemoved(size_t index) { |
| 580 [chooser_bubble_ui_controller_ onOptionRemoved:static_cast<NSInteger>(index)]; | 580 [chooser_bubble_ui_controller_ onOptionRemoved:static_cast<NSInteger>(index)]; |
| 581 } | 581 } |
| 582 | 582 |
| 583 void ChooserBubbleUiCocoa::OnBubbleClosing() { | 583 void ChooserBubbleUiCocoa::OnBubbleClosing() { |
| 584 chooser_bubble_ui_controller_ = nil; | 584 chooser_bubble_ui_controller_ = nil; |
| 585 } | 585 } |
| OLD | NEW |