Chromium Code Reviews| Index: chrome/browser/ui/cocoa/confirm_bubble_model.mm |
| =================================================================== |
| --- chrome/browser/ui/cocoa/confirm_bubble_model.mm (revision 0) |
| +++ chrome/browser/ui/cocoa/confirm_bubble_model.mm (revision 0) |
| @@ -0,0 +1,24 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/ui/confirm_bubble_model.h" |
| + |
| +#include "chrome/browser/ui/cocoa/confirm_bubble_controller.h" |
| +#include "ui/gfx/point.h" |
| + |
| +void ConfirmBubbleModel::Show(gfx::NativeView view, |
|
Robert Sesek
2011/12/15 18:47:09
This could probably just go in the controller.mm f
Hironori Bono
2012/01/05 10:45:55
Thanks for your suggestion. I would like to talk w
|
| + const gfx::Point& origin, |
| + ConfirmBubbleModel* model) { |
| + // Create a custom NSViewController that manages a bubble view, and add it to |
| + // a child to the specified view. This controller will be automatically |
| + // deleted when it loses first-responder status. |
| + ConfirmBubbleController* controller = |
| + [[ConfirmBubbleController alloc] initWithParent:view |
| + origin:origin.ToCGPoint() |
| + model:model]; |
| + [view addSubview:[controller view] |
| + positioned:NSWindowAbove |
| + relativeTo:nil]; |
| + [[view window] makeFirstResponder:[controller view]]; |
| +} |
| Property changes on: chrome/browser/ui/cocoa/confirm_bubble_model.mm |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| + LF |