| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/confirm_bubble_model.h" |
| 6 |
| 7 #include "chrome/browser/ui/cocoa/confirm_bubble_controller.h" |
| 8 #include "ui/gfx/point.h" |
| 9 |
| 10 void ConfirmBubbleModel::Show(gfx::NativeView view, |
| 11 const gfx::Point& origin, |
| 12 ConfirmBubbleModel* model) { |
| 13 // Create a custom NSViewController that manages a bubble view, and add it to |
| 14 // a child to the specified view. This controller will be automatically |
| 15 // deleted when it loses first-responder status. |
| 16 ConfirmBubbleController* controller = |
| 17 [[ConfirmBubbleController alloc] initWithParent:view |
| 18 origin:origin.ToCGPoint() |
| 19 model:model]; |
| 20 [view addSubview:[controller view] |
| 21 positioned:NSWindowAbove |
| 22 relativeTo:nil]; |
| 23 [[view window] makeFirstResponder:[controller view]]; |
| 24 } |
| OLD | NEW |