Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8317)

Unified Diff: chrome/browser/ui/cocoa/confirm_bubble_model.mm

Issue 8697001: Implement confirm bubble for Mac. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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,
+ 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

Powered by Google App Engine
This is Rietveld 408576698