Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1879)

Side by Side Diff: chrome/browser/speech/speech_input_bubble_views.cc

Issue 9369009: Make content::ResourceContext be a real interface like the rest of the Content API (i.e. don't ha... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "chrome/browser/speech/speech_input_bubble.h" 5 #include "chrome/browser/speech/speech_input_bubble.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 } else if (source == try_again_) { 214 } else if (source == try_again_) {
215 delegate_->InfoBubbleButtonClicked(SpeechInputBubble::BUTTON_TRY_AGAIN); 215 delegate_->InfoBubbleButtonClicked(SpeechInputBubble::BUTTON_TRY_AGAIN);
216 } else { 216 } else {
217 NOTREACHED() << "Unknown button"; 217 NOTREACHED() << "Unknown button";
218 } 218 }
219 } 219 }
220 220
221 void SpeechInputBubbleView::LinkClicked(views::Link* source, int event_flags) { 221 void SpeechInputBubbleView::LinkClicked(views::Link* source, int event_flags) {
222 DCHECK_EQ(source, mic_settings_); 222 DCHECK_EQ(source, mic_settings_);
223 speech_input::SpeechInputManager::ShowAudioInputSettingsFromUI( 223 speech_input::SpeechInputManager::ShowAudioInputSettingsFromUI(
224 &web_contents_->GetBrowserContext()->GetResourceContext()); 224 web_contents_->GetBrowserContext()->GetResourceContext());
225 } 225 }
226 226
227 gfx::Size SpeechInputBubbleView::GetPreferredSize() { 227 gfx::Size SpeechInputBubbleView::GetPreferredSize() {
228 int width = heading_->GetPreferredSize().width(); 228 int width = heading_->GetPreferredSize().width();
229 int control_width = cancel_->GetPreferredSize().width(); 229 int control_width = cancel_->GetPreferredSize().width();
230 if (try_again_->visible()) { 230 if (try_again_->visible()) {
231 control_width += try_again_->GetPreferredSize().width() + 231 control_width += try_again_->GetPreferredSize().width() +
232 views::kRelatedButtonHSpacing; 232 views::kRelatedButtonHSpacing;
233 } 233 }
234 width = std::max(width, control_width); 234 width = std::max(width, control_width);
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 } 380 }
381 381
382 } // namespace 382 } // namespace
383 383
384 SpeechInputBubble* SpeechInputBubble::CreateNativeBubble( 384 SpeechInputBubble* SpeechInputBubble::CreateNativeBubble(
385 WebContents* web_contents, 385 WebContents* web_contents,
386 SpeechInputBubble::Delegate* delegate, 386 SpeechInputBubble::Delegate* delegate,
387 const gfx::Rect& element_rect) { 387 const gfx::Rect& element_rect) {
388 return new SpeechInputBubbleImpl(web_contents, delegate, element_rect); 388 return new SpeechInputBubbleImpl(web_contents, delegate, element_rect);
389 } 389 }
OLDNEW
« no previous file with comments | « chrome/browser/speech/speech_input_bubble_gtk.cc ('k') | chrome/browser/speech/speech_input_extension_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698