OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_extension_notification.h" | 5 #include "chrome/browser/speech/speech_input_extension_notification.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/status_icons/status_icon.h" | 10 #include "chrome/browser/status_icons/status_icon.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 NotificationTrayImages::NotificationTrayImages() { | 46 NotificationTrayImages::NotificationTrayImages() { |
47 mic_empty_ = ResourceBundle::GetSharedInstance().GetBitmapNamed( | 47 mic_empty_ = ResourceBundle::GetSharedInstance().GetBitmapNamed( |
48 IDR_SPEECH_INPUT_TRAY_MIC_EMPTY); | 48 IDR_SPEECH_INPUT_TRAY_MIC_EMPTY); |
49 mic_full_ = ResourceBundle::GetSharedInstance().GetBitmapNamed( | 49 mic_full_ = ResourceBundle::GetSharedInstance().GetBitmapNamed( |
50 IDR_SPEECH_INPUT_TRAY_MIC_FULL); | 50 IDR_SPEECH_INPUT_TRAY_MIC_FULL); |
51 balloon_icon_ = ResourceBundle::GetSharedInstance().GetBitmapNamed( | 51 balloon_icon_ = ResourceBundle::GetSharedInstance().GetBitmapNamed( |
52 IDR_SPEECH_INPUT_TRAY_BALLOON_ICON); | 52 IDR_SPEECH_INPUT_TRAY_BALLOON_ICON); |
53 } | 53 } |
54 | 54 |
55 base::LazyInstance<NotificationTrayImages> g_images(base::LINKER_INITIALIZED); | 55 base::LazyInstance<NotificationTrayImages> g_images = LAZY_INSTANCE_INITIALIZER; |
56 | 56 |
57 } // namespace | 57 } // namespace |
58 | 58 |
59 SpeechInputExtensionNotification::SpeechInputExtensionNotification( | 59 SpeechInputExtensionNotification::SpeechInputExtensionNotification( |
60 Profile* profile) | 60 Profile* profile) |
61 : profile_(profile), | 61 : profile_(profile), |
62 tray_icon_(NULL) { | 62 tray_icon_(NULL) { |
63 mic_image_.reset(new SkBitmap()); | 63 mic_image_.reset(new SkBitmap()); |
64 mic_image_->setConfig(SkBitmap::kARGB_8888_Config, | 64 mic_image_->setConfig(SkBitmap::kARGB_8888_Config, |
65 g_images.Get().mic_empty()->width(), | 65 g_images.Get().mic_empty()->width(), |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 const Extension* extension) { | 148 const Extension* extension) { |
149 string16 title = l10n_util::GetStringUTF16( | 149 string16 title = l10n_util::GetStringUTF16( |
150 IDS_SPEECH_INPUT_TRAY_BALLOON_TITLE); | 150 IDS_SPEECH_INPUT_TRAY_BALLOON_TITLE); |
151 string16 message = l10n_util::GetStringFUTF16( | 151 string16 message = l10n_util::GetStringFUTF16( |
152 IDS_SPEECH_INPUT_TRAY_BALLOON_BODY, | 152 IDS_SPEECH_INPUT_TRAY_BALLOON_BODY, |
153 UTF8ToUTF16(extension->name()), | 153 UTF8ToUTF16(extension->name()), |
154 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 154 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
155 | 155 |
156 tray_icon_->DisplayBalloon(*g_images.Get().balloon_icon(), title, message); | 156 tray_icon_->DisplayBalloon(*g_images.Get().balloon_icon(), title, message); |
157 } | 157 } |
OLD | NEW |