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

Unified Diff: ui/app_list/views/speech_view.cc

Issue 146643004: Loads the logo image to the speech UI in app-list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« ui/app_list/speech_ui_model.h ('K') | « ui/app_list/views/speech_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/speech_view.cc
diff --git a/ui/app_list/views/speech_view.cc b/ui/app_list/views/speech_view.cc
index 00d24aa305c304bbb09082c350f6df4e8a43c592..85398e5b9ce9e33ce85998a9d05e200d1ad68e4c 100644
--- a/ui/app_list/views/speech_view.cc
+++ b/ui/app_list/views/speech_view.cc
@@ -16,6 +16,7 @@
#include "ui/views/animation/bounds_animator.h"
#include "ui/views/background.h"
#include "ui/views/controls/button/image_button.h"
+#include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/shadow_border.h"
@@ -29,6 +30,10 @@ const int kShadowBlur = 4;
const int kSpeechViewMaxHeight = 300;
const int kMicButtonMargin = 12;
const int kTextMargin = 32;
+const int kLogoMarginLeft = 30;
+const int kLogoMarginTop = 28;
+const int kLogoWidth = 104;
+const int kLogoHeight = 36;
const int kIndicatorRadiusMax = 100;
const int kIndicatorAnimationDuration = 100;
const SkColor kShadowColor = SkColorSetARGB(0.3 * 255, 0, 0, 0);
@@ -92,7 +97,8 @@ bool MicButton::HitTestRect(const gfx::Rect& rect) const {
// static
SpeechView::SpeechView(AppListViewDelegate* delegate)
- : delegate_(delegate) {
+ : delegate_(delegate),
+ logo_(NULL) {
SetBorder(scoped_ptr<views::Border>(
new views::ShadowBorder(kShadowBlur,
kShadowColor,
@@ -106,7 +112,13 @@ SpeechView::SpeechView(AppListViewDelegate* delegate)
container->set_background(
views::Background::CreateSolidBackground(SK_ColorWHITE));
- // TODO(mukai): add Google logo.
+ const gfx::ImageSkia& logo_image = delegate_->GetSpeechUI()->logo();
+ if (!logo_image.isNull()) {
+ logo_ = new views::ImageView();
+ logo_->SetImage(&logo_image);
+ container->AddChildView(logo_);
+ }
+
indicator_ = new SoundLevelIndicator();
indicator_->SetVisible(false);
container->AddChildView(indicator_);
@@ -157,8 +169,9 @@ void SpeechView::Layout() {
container->SetBoundsRect(GetContentsBounds());
// Because container is a pure View, this class should layout its children.
- // TODO(mukai): arrange Google logo.
const gfx::Rect contents_bounds = container->GetContentsBounds();
+ if (logo_)
+ logo_->SetBounds(kLogoMarginLeft, kLogoMarginTop, kLogoWidth, kLogoHeight);
gfx::Size mic_size = mic_button_->GetPreferredSize();
gfx::Point mic_origin(
contents_bounds.right() - kMicButtonMargin - mic_size.width(),
« ui/app_list/speech_ui_model.h ('K') | « ui/app_list/views/speech_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698