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

Side by Side Diff: chrome/browser/ui/cocoa/confirm_bubble_cocoa.mm

Issue 801043003: Change ShowConfirmBubble() to take model by scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
OLDNEW
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 "base/strings/string16.h" 7 #include "base/strings/string16.h"
8 #include "chrome/browser/themes/theme_service.h" 8 #include "chrome/browser/themes/theme_service.h"
9 #import "chrome/browser/ui/cocoa/confirm_bubble_controller.h" 9 #import "chrome/browser/ui/cocoa/confirm_bubble_controller.h"
10 #include "chrome/browser/ui/confirm_bubble.h" 10 #include "chrome/browser/ui/confirm_bubble.h"
(...skipping 29 matching lines...) Expand all
40 40
41 // Horizontal spacing between the edge of the window and the 41 // Horizontal spacing between the edge of the window and the
42 // left or right of a button. 42 // left or right of a button.
43 const int kButtonHEdgeMargin = 7; 43 const int kButtonHEdgeMargin = 7;
44 44
45 namespace chrome { 45 namespace chrome {
46 46
47 void ShowConfirmBubble(gfx::NativeWindow window, 47 void ShowConfirmBubble(gfx::NativeWindow window,
48 gfx::NativeView anchor_view, 48 gfx::NativeView anchor_view,
49 const gfx::Point& origin, 49 const gfx::Point& origin,
50 ConfirmBubbleModel* model) { 50 scoped_ptr<ConfirmBubbleModel> model) {
51 // Create a custom NSViewController that manages a bubble view, and add it to 51 // Create a custom NSViewController that manages a bubble view, and add it to
52 // a child to the specified |anchor_view|. This controller will be 52 // a child to the specified |anchor_view|. This controller will be
53 // automatically deleted when it loses first-responder status. 53 // automatically deleted when it loses first-responder status.
54 ConfirmBubbleController* controller = 54 ConfirmBubbleController* controller =
55 [[ConfirmBubbleController alloc] initWithParent:anchor_view 55 [[ConfirmBubbleController alloc] initWithParent:anchor_view
56 origin:origin.ToCGPoint() 56 origin:origin.ToCGPoint()
57 model:model]; 57 model:model.Pass()];
58 [anchor_view addSubview:[controller view] 58 [anchor_view addSubview:[controller view]
59 positioned:NSWindowAbove 59 positioned:NSWindowAbove
60 relativeTo:nil]; 60 relativeTo:nil];
61 [[anchor_view window] makeFirstResponder:[controller view]]; 61 [[anchor_view window] makeFirstResponder:[controller view]];
62 } 62 }
63 63
64 } // namespace chrome 64 } // namespace chrome
65 65
66 // An interface that is derived from NSTextView and does not accept 66 // An interface that is derived from NSTextView and does not accept
67 // first-responder status, i.e. a NSTextView-derived class that never becomes 67 // first-responder status, i.e. a NSTextView-derived class that never becomes
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 288
289 - (void)clickCancel { 289 - (void)clickCancel {
290 [self cancel:self]; 290 [self cancel:self];
291 } 291 }
292 292
293 - (void)clickLink { 293 - (void)clickLink {
294 [self textView:messageLabel_.get() clickedOnLink:nil atIndex:0]; 294 [self textView:messageLabel_.get() clickedOnLink:nil atIndex:0];
295 } 295 }
296 296
297 @end 297 @end
OLDNEW
« no previous file with comments | « chrome/browser/renderer_context_menu/spelling_menu_observer.cc ('k') | chrome/browser/ui/cocoa/confirm_bubble_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698