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

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

Issue 10407120: Moving tray icon and notification balloon for background speech recognition sessions to ChromeSpeec… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed win issued ("interface" member clashes with a VS macro name, sigh) Created 8 years, 6 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
« no previous file with comments | « chrome/browser/speech/speech_input_extension_manager.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_recognition_tray_icon_controller.h" 5 #include "chrome/browser/speech/speech_recognition_tray_icon_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/string16.h" 9 #include "base/string16.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 if (StatusTray* status_tray = g_browser_process->status_tray()) { 84 if (StatusTray* status_tray = g_browser_process->status_tray()) {
85 DCHECK(!tray_icon_); 85 DCHECK(!tray_icon_);
86 AddRef(); // Balanced in Hide(). 86 AddRef(); // Balanced in Hide().
87 tray_icon_ = status_tray->CreateStatusIcon(); 87 tray_icon_ = status_tray->CreateStatusIcon();
88 DCHECK(tray_icon_); 88 DCHECK(tray_icon_);
89 VLOG(1) << "Tray icon added."; 89 VLOG(1) << "Tray icon added.";
90 90
91 SetVUMeterVolume(0.0f); 91 SetVUMeterVolume(0.0f);
92 tray_icon_->SetToolTip(l10n_util::GetStringFUTF16( 92 tray_icon_->SetToolTip(l10n_util::GetStringFUTF16(
93 IDS_SPEECH_INPUT_TRAY_TOOLTIP, 93 IDS_SPEECH_INPUT_TRAY_TOOLTIP,
94 tooltip, 94 tooltip));
95 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
96 } else { 95 } else {
97 VLOG(1) << "This platform doesn't support notification icons."; 96 VLOG(1) << "This platform doesn't support notification icons.";
98 return; 97 return;
99 } 98 }
100 99
101 if (show_balloon) 100 if (show_balloon)
102 ShowNotificationBalloon(tooltip); 101 ShowNotificationBalloon(tooltip);
103 } 102 }
104 103
105 void SpeechRecognitionTrayIconController::Hide() { 104 void SpeechRecognitionTrayIconController::Hide() {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 canvas->drawBitmap(*buffer_image_.get(), 0, 0); 184 canvas->drawBitmap(*buffer_image_.get(), 0, 0);
186 } 185 }
187 186
188 void SpeechRecognitionTrayIconController::ShowNotificationBalloon( 187 void SpeechRecognitionTrayIconController::ShowNotificationBalloon(
189 const string16& text) { 188 const string16& text) {
190 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 189 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
191 string16 title = l10n_util::GetStringUTF16( 190 string16 title = l10n_util::GetStringUTF16(
192 IDS_SPEECH_INPUT_TRAY_BALLOON_TITLE); 191 IDS_SPEECH_INPUT_TRAY_BALLOON_TITLE);
193 string16 message = l10n_util::GetStringFUTF16( 192 string16 message = l10n_util::GetStringFUTF16(
194 IDS_SPEECH_INPUT_TRAY_BALLOON_BODY, 193 IDS_SPEECH_INPUT_TRAY_BALLOON_BODY,
195 text, 194 text);
196 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
197 195
198 tray_icon_->DisplayBalloon(*g_images.Get().balloon_icon(), title, message); 196 tray_icon_->DisplayBalloon(*g_images.Get().balloon_icon(), title, message);
199 } 197 }
OLDNEW
« no previous file with comments | « chrome/browser/speech/speech_input_extension_manager.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698