OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "chrome/browser/speech/speech_recognition_bubble.h" | 7 #include "chrome/browser/speech/speech_recognition_bubble.h" |
8 | 8 |
9 #import "base/memory/scoped_nsobject.h" | 9 #import "base/mac/scoped_nsobject.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
11 #include "chrome/browser/ui/cocoa/browser_window_cocoa.h" | 11 #include "chrome/browser/ui/cocoa/browser_window_cocoa.h" |
12 #include "chrome/browser/ui/cocoa/browser_window_controller.h" | 12 #include "chrome/browser/ui/cocoa/browser_window_controller.h" |
13 #include "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" | 13 #include "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" |
14 #import "chrome/browser/ui/cocoa/speech_recognition_window_controller.h" | 14 #import "chrome/browser/ui/cocoa/speech_recognition_window_controller.h" |
15 #include "content/public/browser/web_contents.h" | 15 #include "content/public/browser/web_contents.h" |
16 #include "content/public/browser/web_contents_view.h" | 16 #include "content/public/browser/web_contents_view.h" |
17 #include "ui/gfx/image/image_skia_util_mac.h" | 17 #include "ui/gfx/image/image_skia_util_mac.h" |
18 | 18 |
19 using content::WebContents; | 19 using content::WebContents; |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 // A class to bridge between the speech recognition C++ code and the Objective-C | 23 // A class to bridge between the speech recognition C++ code and the Objective-C |
24 // bubble implementation. See chrome/browser/speech/speech_recognition_bubble.h | 24 // bubble implementation. See chrome/browser/speech/speech_recognition_bubble.h |
25 // for more information on how this gets used. | 25 // for more information on how this gets used. |
26 class SpeechRecognitionBubbleImpl : public SpeechRecognitionBubbleBase { | 26 class SpeechRecognitionBubbleImpl : public SpeechRecognitionBubbleBase { |
27 public: | 27 public: |
28 SpeechRecognitionBubbleImpl(WebContents* web_contents, | 28 SpeechRecognitionBubbleImpl(WebContents* web_contents, |
29 Delegate* delegate, | 29 Delegate* delegate, |
30 const gfx::Rect& element_rect); | 30 const gfx::Rect& element_rect); |
31 virtual ~SpeechRecognitionBubbleImpl(); | 31 virtual ~SpeechRecognitionBubbleImpl(); |
32 virtual void Show() OVERRIDE; | 32 virtual void Show() OVERRIDE; |
33 virtual void Hide() OVERRIDE; | 33 virtual void Hide() OVERRIDE; |
34 virtual void UpdateLayout() OVERRIDE; | 34 virtual void UpdateLayout() OVERRIDE; |
35 virtual void UpdateImage() OVERRIDE; | 35 virtual void UpdateImage() OVERRIDE; |
36 | 36 |
37 private: | 37 private: |
38 scoped_nsobject<SpeechRecognitionWindowController> window_; | 38 base::scoped_nsobject<SpeechRecognitionWindowController> window_; |
39 Delegate* delegate_; | 39 Delegate* delegate_; |
40 gfx::Rect element_rect_; | 40 gfx::Rect element_rect_; |
41 }; | 41 }; |
42 | 42 |
43 SpeechRecognitionBubbleImpl::SpeechRecognitionBubbleImpl( | 43 SpeechRecognitionBubbleImpl::SpeechRecognitionBubbleImpl( |
44 WebContents* web_contents, | 44 WebContents* web_contents, |
45 Delegate* delegate, | 45 Delegate* delegate, |
46 const gfx::Rect& element_rect) | 46 const gfx::Rect& element_rect) |
47 : SpeechRecognitionBubbleBase(web_contents), | 47 : SpeechRecognitionBubbleBase(web_contents), |
48 delegate_(delegate), | 48 delegate_(delegate), |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 } | 124 } |
125 | 125 |
126 } // namespace | 126 } // namespace |
127 | 127 |
128 SpeechRecognitionBubble* SpeechRecognitionBubble::CreateNativeBubble( | 128 SpeechRecognitionBubble* SpeechRecognitionBubble::CreateNativeBubble( |
129 WebContents* web_contents, | 129 WebContents* web_contents, |
130 Delegate* delegate, | 130 Delegate* delegate, |
131 const gfx::Rect& element_rect) { | 131 const gfx::Rect& element_rect) { |
132 return new SpeechRecognitionBubbleImpl(web_contents, delegate, element_rect); | 132 return new SpeechRecognitionBubbleImpl(web_contents, delegate, element_rect); |
133 } | 133 } |
OLD | NEW |