OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_COCOA_TAB_CONTENTS_SAD_TAB_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_TAB_CONTENTS_SAD_TAB_VIEW_H_ |
6 #define CHROME_BROWSER_UI_COCOA_TAB_CONTENTS_SAD_TAB_VIEW_H_ | 6 #define CHROME_BROWSER_UI_COCOA_TAB_CONTENTS_SAD_TAB_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/scoped_nsobject.h" | 9 #include "base/memory/scoped_nsobject.h" |
10 #include "chrome/browser/ui/cocoa/base_view.h" | 10 #include "chrome/browser/ui/cocoa/base_view.h" |
11 | 11 |
12 #import <Cocoa/Cocoa.h> | 12 #import <Cocoa/Cocoa.h> |
13 | 13 |
14 @class HyperlinkButtonCell; | 14 @class SadTabController; |
| 15 @class HyperlinkTextView; |
15 | 16 |
16 // A view that displays the "sad tab" (aka crash page). | 17 // A view that displays the "sad tab" (aka crash page). |
17 @interface SadTabView : BaseView { | 18 @interface SadTabView : BaseView { |
18 @private | 19 @private |
19 IBOutlet NSImageView* image_; | 20 IBOutlet NSImageView* image_; |
20 IBOutlet NSTextField* title_; | 21 IBOutlet NSTextField* title_; |
21 IBOutlet NSTextField* message_; | 22 IBOutlet NSTextField* message_; |
22 IBOutlet NSButton* linkButton_; | 23 IBOutlet NSTextField* helpPlaceholder_; |
23 IBOutlet HyperlinkButtonCell* linkCell_; | |
24 | 24 |
25 scoped_nsobject<NSColor> backgroundColor_; | 25 scoped_nsobject<NSColor> backgroundColor_; |
26 NSSize messageSize_; | 26 NSSize messageSize_; |
| 27 |
| 28 // Text fields don't work as well with embedded links as text views, but |
| 29 // text views cannot conveniently be created in IB. The xib file contains |
| 30 // a text field |helpPlaceholder_| that's replaced by this text view |help_| |
| 31 // in -awakeFromNib. |
| 32 scoped_nsobject<HyperlinkTextView> help_; |
| 33 |
| 34 // A weak reference to the parent controller. |
| 35 IBOutlet SadTabController* controller_; |
27 } | 36 } |
28 | 37 |
29 // Designated initializer is -initWithFrame: . | 38 // Designated initializer is -initWithFrame: . |
30 | 39 |
31 // Called by SadTabController to remove link button. | 40 // Called by SadTabController to remove the help text and link. |
32 - (void)removeLinkButton; | 41 - (void)removeHelpText; |
| 42 |
| 43 // Sets |help_| based on |helpPlaceholder_|, sets |helpPlaceholder_| to nil. |
| 44 - (void)initializeHelpText; |
33 | 45 |
34 @end | 46 @end |
35 | 47 |
36 #endif // CHROME_BROWSER_UI_COCOA_TAB_CONTENTS_SAD_TAB_VIEW_H_ | 48 #endif // CHROME_BROWSER_UI_COCOA_TAB_CONTENTS_SAD_TAB_VIEW_H_ |
OLD | NEW |