OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.h" | 5 #include "chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
9 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" | 9 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" |
| 10 #include "chrome/browser/ui/cocoa/event_utils.h" |
10 #import "chrome/browser/ui/cocoa/hyperlink_text_view.h" | 11 #import "chrome/browser/ui/cocoa/hyperlink_text_view.h" |
11 #include "chrome/browser/ui/cocoa/event_utils.h" | |
12 #include "chrome/browser/ui/cocoa/infobars/infobar.h" | 12 #include "chrome/browser/ui/cocoa/infobars/infobar.h" |
13 #include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" | 13 #include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" |
14 #include "webkit/glue/window_open_disposition.h" | 14 #include "ui/base/window_open_disposition.h" |
15 | 15 |
16 @implementation ConfirmInfoBarController | 16 @implementation ConfirmInfoBarController |
17 | 17 |
18 // Called when someone clicks on the "OK" button. | 18 // Called when someone clicks on the "OK" button. |
19 - (IBAction)ok:(id)sender { | 19 - (IBAction)ok:(id)sender { |
20 if (![self isOwned]) | 20 if (![self isOwned]) |
21 return; | 21 return; |
22 if (delegate_->AsConfirmInfoBarDelegate()->Accept()) | 22 if (delegate_->AsConfirmInfoBarDelegate()->Accept()) |
23 [self removeSelf]; | 23 [self removeSelf]; |
24 } | 24 } |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 [self removeSelf]; | 134 [self removeSelf]; |
135 } | 135 } |
136 | 136 |
137 @end | 137 @end |
138 | 138 |
139 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar(InfoBarService* owner) { | 139 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar(InfoBarService* owner) { |
140 ConfirmInfoBarController* controller = | 140 ConfirmInfoBarController* controller = |
141 [[ConfirmInfoBarController alloc] initWithDelegate:this owner:owner]; | 141 [[ConfirmInfoBarController alloc] initWithDelegate:this owner:owner]; |
142 return new InfoBar(controller, this); | 142 return new InfoBar(controller, this); |
143 } | 143 } |
OLD | NEW |