| 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/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
| 9 #include "chrome/browser/infobars/confirm_infobar_delegate.h" | 9 #include "chrome/browser/infobars/confirm_infobar_delegate.h" |
| 10 #import "chrome/browser/ui/cocoa/hyperlink_text_view.h" | 10 #import "chrome/browser/ui/cocoa/hyperlink_text_view.h" |
| 11 #include "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h" | 11 #include "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h" |
| 12 #include "third_party/google_toolbox_for_mac/src/AppKit/GTMUILocalizerAndLayoutT
weaker.h" | 12 #include "third_party/google_toolbox_for_mac/src/AppKit/GTMUILocalizerAndLayoutT
weaker.h" |
| 13 #import "ui/base/cocoa/cocoa_event_utils.h" | 13 #import "ui/base/cocoa/cocoa_base_utils.h" |
| 14 #include "ui/base/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 ([self delegate]->AsConfirmInfoBarDelegate()->Accept()) | 22 if ([self delegate]->AsConfirmInfoBarDelegate()->Accept()) |
| 23 [self removeSelf]; | 23 [self removeSelf]; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // static | 140 // static |
| 141 scoped_ptr<InfoBar> ConfirmInfoBarDelegate::CreateInfoBar( | 141 scoped_ptr<InfoBar> ConfirmInfoBarDelegate::CreateInfoBar( |
| 142 scoped_ptr<ConfirmInfoBarDelegate> delegate) { | 142 scoped_ptr<ConfirmInfoBarDelegate> delegate) { |
| 143 scoped_ptr<InfoBarCocoa> infobar( | 143 scoped_ptr<InfoBarCocoa> infobar( |
| 144 new InfoBarCocoa(delegate.PassAs<InfoBarDelegate>())); | 144 new InfoBarCocoa(delegate.PassAs<InfoBarDelegate>())); |
| 145 base::scoped_nsobject<ConfirmInfoBarController> controller( | 145 base::scoped_nsobject<ConfirmInfoBarController> controller( |
| 146 [[ConfirmInfoBarController alloc] initWithInfoBar:infobar.get()]); | 146 [[ConfirmInfoBarController alloc] initWithInfoBar:infobar.get()]); |
| 147 infobar->set_controller(controller); | 147 infobar->set_controller(controller); |
| 148 return infobar.PassAs<InfoBar>(); | 148 return infobar.PassAs<InfoBar>(); |
| 149 } | 149 } |
| OLD | NEW |