Chromium Code Reviews
|
| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
|
Robert Sesek
2011/11/28 15:55:39
#if guards
Hironori Bono
2011/12/09 11:14:32
Done.
| |
| 5 #import <Cocoa/Cocoa.h> | |
| 6 | |
| 7 #import "base/mac/cocoa_protocols.h" | |
| 8 #include "base/memory/scoped_nsobject.h" | |
| 9 | |
| 10 @class ConfirmBubbleController; | |
| 11 class ConfirmBubbleModel; | |
| 12 | |
| 13 // A view class that implements a bubble consisting of the following items: | |
| 14 // * one icon ("icon") | |
| 15 // * one title text ("title") | |
| 16 // * one message text ("message") | |
| 17 // * one optional link ("link") | |
| 18 // * two optional buttons ("ok" and "cancel") | |
|
Mark Mentovai
2011/11/28 14:33:06
It has a close button too?
Hironori Bono
2011/12/09 11:14:32
As written below, I have removed the close button
| |
| 19 // | |
| 20 // This bubble is convenient when we wish to ask transient, non-blocking | |
| 21 // questions. Unlike a dialog, a bubble menu disappears when we click outside of | |
| 22 // its window to avoid blocking user operations. A bubble is laid out as | |
| 23 // follows: | |
| 24 // | |
| 25 // +------------------------+ | |
| 26 // | icon title x | | |
|
Robert Sesek
2011/11/28 15:55:39
It's a little odd to have the close button on the
Hironori Bono
2011/12/09 11:14:32
Thanks for noticing it. This change straightforwar
| |
| 27 // | message | | |
| 28 // | link | | |
| 29 // | [OK] [Cancel] | | |
|
Mark Mentovai
2011/11/28 14:33:06
Normal Mac button ordering in dialogs is to put th
Hironori Bono
2011/12/09 11:14:32
Done.
| |
| 30 // +------------------------+ | |
| 31 // | |
| 32 @interface ConfirmBubbleView : NSView<NSTextViewDelegate> { | |
| 33 @private | |
| 34 NSView* parent_; // weak | |
| 35 ConfirmBubbleController* controller_; // weak | |
| 36 | |
| 37 // Controls used in this bubble. | |
| 38 scoped_nsobject<NSImageView> icon_; | |
| 39 scoped_nsobject<NSTextView> titleLabel_; | |
| 40 scoped_nsobject<NSButton> closeButton_; | |
| 41 scoped_nsobject<NSTextView> messageLabel_; | |
| 42 scoped_nsobject<NSButton> okButton_; | |
| 43 scoped_nsobject<NSButton> cancelButton_; | |
| 44 } | |
| 45 | |
| 46 // Initializes a bubble view and sets it to the first responder of |parent|. | |
| 47 // Since this initializer programmatically creates a custom NSView (i.e. without | |
| 48 // using a nib file), this function should be called from loadView: of the | |
| 49 // controller object which owns this view. | |
| 50 - (id)initWithParent:(NSView*)parent | |
| 51 controller:(ConfirmBubbleController*)controller; | |
| 52 | |
| 53 @end | |
| OLD | NEW |