OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 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 | |
5 #ifndef CHROME_BROWSER_UI_COCOA_SPEECH_RECOGNITION_WINDOW_CONTROLLER_H_ | |
6 #define CHROME_BROWSER_UI_COCOA_SPEECH_RECOGNITION_WINDOW_CONTROLLER_H_ | |
7 | |
8 #import <Cocoa/Cocoa.h> | |
9 | |
10 #include "chrome/browser/speech/speech_recognition_bubble.h" | |
11 #include "chrome/browser/ui/cocoa/base_bubble_controller.h" | |
12 | |
13 // Controller for the speech recognition bubble window. This bubble window gets | |
14 // displayed when the user starts speech input in a html input element. | |
15 @interface SpeechRecognitionWindowController : BaseBubbleController { | |
16 @private | |
17 SpeechRecognitionBubble::Delegate* delegate_; // weak. | |
18 SpeechRecognitionBubbleBase::DisplayMode displayMode_; | |
19 | |
20 // References below are weak, being obtained from the nib. | |
21 IBOutlet NSImageView* iconImage_; | |
22 IBOutlet NSTextField* instructionLabel_; | |
23 IBOutlet NSButton* cancelButton_; | |
24 IBOutlet NSButton* tryAgainButton_; | |
25 IBOutlet NSButton* micSettingsButton_; | |
26 } | |
27 | |
28 // Initialize the window. |anchoredAt| is in screen coordinates. | |
29 - (id)initWithParentWindow:(NSWindow*)parentWindow | |
30 delegate:(SpeechRecognitionBubbleDelegate*)delegate | |
31 anchoredAt:(NSPoint)anchoredAt; | |
32 | |
33 // Handler for the cancel button. | |
34 - (IBAction)cancel:(id)sender; | |
35 | |
36 // Handler for the try again button. | |
37 - (IBAction)tryAgain:(id)sender; | |
38 | |
39 // Handler for the mic settings button. | |
40 - (IBAction)micSettings:(id)sender; | |
41 | |
42 // Updates the UI with data related to the given display mode. | |
43 - (void)updateLayout:(SpeechRecognitionBubbleBase::DisplayMode)mode | |
44 messageText:(const base::string16&)messageText | |
45 iconImage:(NSImage*)iconImage; | |
46 | |
47 // Makes the speech recognition bubble visible on screen. | |
48 - (void)show; | |
49 | |
50 // Hides the speech recognition bubble away from screen. This does NOT release | |
51 // the controller and the window. | |
52 - (void)hide; | |
53 | |
54 // Sets the image to be displayed in the bubble's status ImageView. A future | |
55 // call to updateLayout may change the image. | |
56 // TODO(satish): Clean that up and move it into the platform independent | |
57 // SpeechRecognitionBubbleBase class. | |
58 - (void)setImage:(NSImage*)image; | |
59 | |
60 @end | |
61 | |
62 #endif // CHROME_BROWSER_UI_COCOA_SPEECH_RECOGNITION_WINDOW_CONTROLLER_H_ | |
OLD | NEW |