| 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 #import "chrome/browser/ui/cocoa/infobars/alternate_nav_infobar_controller.h" | 5 #import "chrome/browser/ui/cocoa/infobars/alternate_nav_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/ui/cocoa/event_utils.h" |
| 9 #import "chrome/browser/ui/cocoa/hyperlink_text_view.h" | 10 #import "chrome/browser/ui/cocoa/hyperlink_text_view.h" |
| 10 #include "chrome/browser/ui/cocoa/event_utils.h" | |
| 11 #include "chrome/browser/ui/cocoa/infobars/infobar.h" | 11 #include "chrome/browser/ui/cocoa/infobars/infobar.h" |
| 12 #include "chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.h" | 12 #include "chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.h" |
| 13 #include "webkit/glue/window_open_disposition.h" | 13 #include "ui/base/window_open_disposition.h" |
| 14 | 14 |
| 15 @implementation AlternateNavInfoBarController | 15 @implementation AlternateNavInfoBarController |
| 16 | 16 |
| 17 // Link infobars have a text message, of which part is linkified. We | 17 // Link infobars have a text message, of which part is linkified. We |
| 18 // use an NSAttributedString to display styled text, and we set a | 18 // use an NSAttributedString to display styled text, and we set a |
| 19 // NSLink attribute on the hyperlink portion of the message. Infobars | 19 // NSLink attribute on the hyperlink portion of the message. Infobars |
| 20 // use a custom NSTextField subclass, which allows us to override | 20 // use a custom NSTextField subclass, which allows us to override |
| 21 // textView:clickedOnLink:atIndex: and intercept clicks. | 21 // textView:clickedOnLink:atIndex: and intercept clicks. |
| 22 // | 22 // |
| 23 - (void)addAdditionalControls { | 23 - (void)addAdditionalControls { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 53 [self removeSelf]; | 53 [self removeSelf]; |
| 54 } | 54 } |
| 55 | 55 |
| 56 @end | 56 @end |
| 57 | 57 |
| 58 InfoBar* AlternateNavInfoBarDelegate::CreateInfoBar(InfoBarService* owner) { | 58 InfoBar* AlternateNavInfoBarDelegate::CreateInfoBar(InfoBarService* owner) { |
| 59 AlternateNavInfoBarController* controller = | 59 AlternateNavInfoBarController* controller = |
| 60 [[AlternateNavInfoBarController alloc] initWithDelegate:this owner:owner]; | 60 [[AlternateNavInfoBarController alloc] initWithDelegate:this owner:owner]; |
| 61 return new InfoBar(controller, this); | 61 return new InfoBar(controller, this); |
| 62 } | 62 } |
| OLD | NEW |