| 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_controller.h" | 5 #import "chrome/browser/ui/cocoa/confirm_bubble_controller.h" |
| 6 | 6 |
| 7 #include "base/mac/mac_util.h" | 7 #include "base/mac/mac_util.h" |
| 8 #include "base/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
| 9 #import "chrome/browser/ui/cocoa/confirm_bubble_view.h" | 9 #import "chrome/browser/ui/cocoa/confirm_bubble_view.h" |
| 10 #import "chrome/browser/ui/confirm_bubble_model.h" | 10 #import "chrome/browser/ui/confirm_bubble_model.h" |
| 11 #include "ui/gfx/image/image.h" | 11 #include "ui/gfx/image/image.h" |
| 12 #include "ui/gfx/point.h" | 12 #include "ui/gfx/point.h" |
| 13 | 13 |
| 14 @implementation ConfirmBubbleController | 14 @implementation ConfirmBubbleController |
| 15 | 15 |
| 16 - (id)initWithParent:(NSView*)parent | 16 - (id)initWithParent:(NSView*)parent |
| 17 origin:(CGPoint)origin | 17 origin:(CGPoint)origin |
| 18 model:(ConfirmBubbleModel*)model { | 18 model:(ConfirmBubbleModel*)model { |
| 19 if ((self = [super initWithNibName:nil bundle:nil])) { | 19 if ((self = [super initWithNibName:nil bundle:nil])) { |
| 20 parent_ = parent; | 20 parent_ = parent; |
| 21 origin_ = origin; | 21 origin_ = origin; |
| 22 model_ = model; | 22 model_.reset(model); |
| 23 } | 23 } |
| 24 return self; | 24 return self; |
| 25 } | 25 } |
| 26 | 26 |
| 27 - (void)loadView { | 27 - (void)loadView { |
| 28 [self setView:[[[ConfirmBubbleView alloc] initWithParent:parent_ | 28 [self setView:[[[ConfirmBubbleView alloc] initWithParent:parent_ |
| 29 controller:self] autorelease]]; | 29 controller:self] autorelease]]; |
| 30 } | 30 } |
| 31 | 31 |
| 32 - (void)windowWillClose:(NSNotification*)notification { | 32 - (void)windowWillClose:(NSNotification*)notification { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 - (void)cancel { | 82 - (void)cancel { |
| 83 model_->Cancel(); | 83 model_->Cancel(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 - (void)linkClicked { | 86 - (void)linkClicked { |
| 87 model_->LinkClicked(); | 87 model_->LinkClicked(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 @end | 90 @end |
| OLD | NEW |