| 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 11 matching lines...) Expand all Loading... |
| 22 #import "chrome/browser/ui/cocoa/info_bubble_view.h" | 22 #import "chrome/browser/ui/cocoa/info_bubble_view.h" |
| 23 #import "chrome/browser/ui/cocoa/info_bubble_window.h" | 23 #import "chrome/browser/ui/cocoa/info_bubble_window.h" |
| 24 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" | 24 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" |
| 25 #include "chrome/browser/ui/website_settings/chooser_bubble_delegate.h" | 25 #include "chrome/browser/ui/website_settings/chooser_bubble_delegate.h" |
| 26 #include "components/bubble/bubble_controller.h" | 26 #include "components/bubble/bubble_controller.h" |
| 27 #include "content/public/browser/native_web_keyboard_event.h" | 27 #include "content/public/browser/native_web_keyboard_event.h" |
| 28 #include "ui/base/cocoa/cocoa_base_utils.h" | 28 #include "ui/base/cocoa/cocoa_base_utils.h" |
| 29 #include "ui/base/cocoa/window_size_constants.h" | 29 #include "ui/base/cocoa/window_size_constants.h" |
| 30 | 30 |
| 31 std::unique_ptr<BubbleUi> ChooserBubbleDelegate::BuildBubbleUi() { | 31 std::unique_ptr<BubbleUi> ChooserBubbleDelegate::BuildBubbleUi() { |
| 32 return base::WrapUnique( | 32 return base::MakeUnique<ChooserBubbleUiCocoa>(browser_, |
| 33 new ChooserBubbleUiCocoa(browser_, std::move(chooser_controller_))); | 33 std::move(chooser_controller_)); |
| 34 } | 34 } |
| 35 | 35 |
| 36 @interface ChooserBubbleUiController | 36 @interface ChooserBubbleUiController |
| 37 : BaseBubbleController<NSTableViewDataSource, NSTableViewDelegate> { | 37 : BaseBubbleController<NSTableViewDataSource, NSTableViewDelegate> { |
| 38 @private | 38 @private |
| 39 // Bridge to the C++ class that created this object. | 39 // Bridge to the C++ class that created this object. |
| 40 ChooserBubbleUiCocoa* bridge_; // Weak. | 40 ChooserBubbleUiCocoa* bridge_; // Weak. |
| 41 bool buttonPressed_; | 41 bool buttonPressed_; |
| 42 | 42 |
| 43 base::scoped_nsobject<ChooserContentViewCocoa> chooserContentView_; | 43 base::scoped_nsobject<ChooserContentViewCocoa> chooserContentView_; |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 } | 313 } |
| 314 | 314 |
| 315 void ChooserBubbleUiCocoa::UpdateAnchorPosition() { | 315 void ChooserBubbleUiCocoa::UpdateAnchorPosition() { |
| 316 if (chooser_bubble_ui_controller_) | 316 if (chooser_bubble_ui_controller_) |
| 317 [chooser_bubble_ui_controller_ updateAnchorPosition]; | 317 [chooser_bubble_ui_controller_ updateAnchorPosition]; |
| 318 } | 318 } |
| 319 | 319 |
| 320 void ChooserBubbleUiCocoa::OnBubbleClosing() { | 320 void ChooserBubbleUiCocoa::OnBubbleClosing() { |
| 321 chooser_bubble_ui_controller_ = nil; | 321 chooser_bubble_ui_controller_ = nil; |
| 322 } | 322 } |
| OLD | NEW |