| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/confirm_bubble_cocoa.h" | 5 #import "chrome/browser/ui/cocoa/confirm_bubble_cocoa.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "chrome/browser/themes/theme_service.h" | 10 #include "chrome/browser/themes/theme_service.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 // Horizontal spacing between the edge of the window and the | 40 // Horizontal spacing between the edge of the window and the |
| 41 // left or right of a button. | 41 // left or right of a button. |
| 42 const int kButtonHEdgeMargin = 7; | 42 const int kButtonHEdgeMargin = 7; |
| 43 | 43 |
| 44 namespace chrome { | 44 namespace chrome { |
| 45 | 45 |
| 46 void ShowConfirmBubble(gfx::NativeWindow window, | 46 void ShowConfirmBubble(gfx::NativeWindow window, |
| 47 gfx::NativeView anchor_view, | 47 gfx::NativeView anchor_view, |
| 48 const gfx::Point& origin, | 48 const gfx::Point& origin, |
| 49 scoped_ptr<ConfirmBubbleModel> model) { | 49 std::unique_ptr<ConfirmBubbleModel> model) { |
| 50 // Create a custom NSViewController that manages a bubble view, and add it to | 50 // Create a custom NSViewController that manages a bubble view, and add it to |
| 51 // a child to the specified |anchor_view|. This controller will be | 51 // a child to the specified |anchor_view|. This controller will be |
| 52 // automatically deleted when it loses first-responder status. | 52 // automatically deleted when it loses first-responder status. |
| 53 ConfirmBubbleController* controller = | 53 ConfirmBubbleController* controller = |
| 54 [[ConfirmBubbleController alloc] initWithParent:anchor_view | 54 [[ConfirmBubbleController alloc] initWithParent:anchor_view |
| 55 origin:origin.ToCGPoint() | 55 origin:origin.ToCGPoint() |
| 56 model:std::move(model)]; | 56 model:std::move(model)]; |
| 57 [anchor_view addSubview:[controller view] | 57 [anchor_view addSubview:[controller view] |
| 58 positioned:NSWindowAbove | 58 positioned:NSWindowAbove |
| 59 relativeTo:nil]; | 59 relativeTo:nil]; |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 277 |
| 278 - (void)clickCancel { | 278 - (void)clickCancel { |
| 279 [self cancel:self]; | 279 [self cancel:self]; |
| 280 } | 280 } |
| 281 | 281 |
| 282 - (void)clickLink { | 282 - (void)clickLink { |
| 283 [self textView:messageLabel_.get() clickedOnLink:nil atIndex:0]; | 283 [self textView:messageLabel_.get() clickedOnLink:nil atIndex:0]; |
| 284 } | 284 } |
| 285 | 285 |
| 286 @end | 286 @end |
| OLD | NEW |