Commit 7e481016 authored by mukai's avatar mukai Committed by Commit bot

Shows the static logo image in athena home card.

This CL depends on https://codereview.chromium.org/512943003/

BUG=408373
R=oshima@chromium.org
TBR=tony@chromium.org
TEST=manually

Review URL: https://codereview.chromium.org/515723003

Cr-Commit-Position: refs/heads/master@{#292335}
parent 0184ced8
...@@ -7,9 +7,11 @@ include_rules = [ ...@@ -7,9 +7,11 @@ include_rules = [
"+third_party/skia/include", "+third_party/skia/include",
"+ui/aura", "+ui/aura",
"+ui/app_list", "+ui/app_list",
"+ui/base/resource/resource_bundle.h",
"+ui/compositor", "+ui/compositor",
"+ui/events", "+ui/events",
"+ui/gfx", "+ui/gfx",
"+ui/resources/grit/ui_resources.h",
"+ui/views", "+ui/views",
"+ui/wm/core", "+ui/wm/core",
"+ui/wm/public", "+ui/wm/public",
......
...@@ -19,36 +19,13 @@ ...@@ -19,36 +19,13 @@
#include "ui/app_list/search_provider.h" #include "ui/app_list/search_provider.h"
#include "ui/app_list/search_result.h" #include "ui/app_list/search_result.h"
#include "ui/app_list/speech_ui_model.h" #include "ui/app_list/speech_ui_model.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image_skia.h" #include "ui/gfx/image/image_skia.h"
#include "ui/views/background.h" #include "ui/resources/grit/ui_resources.h"
#include "ui/views/view.h" #include "ui/views/controls/image_view.h"
namespace athena { namespace athena {
namespace {
// A view to draw the logo area of app-list centered view.
// TODO(mukai): replace this by the actual start page webview.
class DummyLogoView : public views::View {
public:
explicit DummyLogoView(const gfx::Size& size)
: size_(size) {
set_background(views::Background::CreateSolidBackground(
SK_ColorLTGRAY));
}
private:
virtual gfx::Size GetPreferredSize() const OVERRIDE {
return size_;
}
const gfx::Size size_;
DISALLOW_COPY_AND_ASSIGN(DummyLogoView);
};
}
AppListViewDelegate::AppListViewDelegate(AppModelBuilder* model_builder) AppListViewDelegate::AppListViewDelegate(AppModelBuilder* model_builder)
: model_(new app_list::AppListModel), : model_(new app_list::AppListModel),
speech_ui_(new app_list::SpeechUIModel( speech_ui_(new app_list::SpeechUIModel(
...@@ -182,7 +159,14 @@ void AppListViewDelegate::ShowForProfileByPath( ...@@ -182,7 +159,14 @@ void AppListViewDelegate::ShowForProfileByPath(
views::View* AppListViewDelegate::CreateStartPageWebView( views::View* AppListViewDelegate::CreateStartPageWebView(
const gfx::Size& size) { const gfx::Size& size) {
return new DummyLogoView(size); // A static image of the logo. This needs to support dynamic Doodles
// eventually.
views::ImageView* logo_image = new views::ImageView();
logo_image->SetImage(ui::ResourceBundle::GetSharedInstance().
GetImageSkiaNamed(IDR_LOCAL_NTP_IMAGES_LOGO_PNG));
logo_image->SetHorizontalAlignment(views::ImageView::CENTER);
logo_image->SetVerticalAlignment(views::ImageView::CENTER);
return logo_image;
} }
std::vector<views::View*> AppListViewDelegate::CreateCustomPageWebViews( std::vector<views::View*> AppListViewDelegate::CreateCustomPageWebViews(
......
...@@ -171,7 +171,8 @@ AthenaStartPageView::AthenaStartPageView( ...@@ -171,7 +171,8 @@ AthenaStartPageView::AthenaStartPageView(
logo_ = view_delegate->CreateStartPageWebView( logo_ = view_delegate->CreateStartPageWebView(
gfx::Size(kWebViewWidth, kWebViewHeight)); gfx::Size(kWebViewWidth, kWebViewHeight));
logo_->SetPaintToLayer(true); logo_->SetPaintToLayer(true);
logo_->SetSize(logo_->GetPreferredSize()); logo_->SetFillsBoundsOpaquely(false);
logo_->SetSize(gfx::Size(kWebViewWidth, kWebViewHeight));
AddChildView(logo_); AddChildView(logo_);
search_results_view_ = new app_list::SearchResultListView( search_results_view_ = new app_list::SearchResultListView(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment