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

Side by Side Diff: athena/main/placeholder.cc

Issue 287253003: Add initial home card impl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | « athena/main/athena_main.cc ('k') | athena/screen/public/screen_manager.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "athena/main/placeholder.h" 5 #include "athena/main/placeholder.h"
6 6
7 #include "athena/screen/public/screen_manager.h" 7 #include "athena/screen/public/screen_manager.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "third_party/skia/include/core/SkColor.h" 10 #include "third_party/skia/include/core/SkColor.h"
11 #include "ui/gfx/canvas.h" 11 #include "ui/gfx/canvas.h"
12 #include "ui/gfx/image/image_skia.h" 12 #include "ui/gfx/image/image_skia.h"
13 #include "ui/views/background.h" 13 #include "ui/views/background.h"
14 #include "ui/views/controls/label.h" 14 #include "ui/views/controls/label.h"
15 #include "ui/views/painter.h" 15 #include "ui/views/painter.h"
16 #include "ui/views/widget/widget.h" 16 #include "ui/views/widget/widget.h"
17 17
18 void CreateTestWindows() { 18 void CreateTestWindows() {
19 const int kAppWindowBackgroundColor = 0xFFDDDDDD;
19 views::Widget* test_app_widget = new views::Widget; 20 views::Widget* test_app_widget = new views::Widget;
20 // Athena doesn't have frame yet. 21 // Athena doesn't have frame yet.
21 views::Widget::InitParams params( 22 views::Widget::InitParams params(
22 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); 23 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
23 params.context = athena::ScreenManager::Get()->GetContext(); 24 params.context = athena::ScreenManager::Get()->GetContext();
24 test_app_widget->Init(params); 25 test_app_widget->Init(params);
25 views::Label* label = new views::Label; 26 views::Label* label = new views::Label;
26 label->SetText(base::ASCIIToUTF16("AppWindow")); 27 label->SetText(base::ASCIIToUTF16("AppWindow"));
27 label->set_background( 28 label->set_background(
28 views::Background::CreateSolidBackground(SK_ColorWHITE)); 29 views::Background::CreateSolidBackground(kAppWindowBackgroundColor));
29 test_app_widget->SetContentsView(label); 30 test_app_widget->SetContentsView(label);
30 test_app_widget->Show(); 31 test_app_widget->Show();
31 } 32 }
32 33
33 void SetupBackgroundImage() { 34 void SetupBackgroundImage() {
34 gfx::Size size(200, 200); 35 gfx::Size size(200, 200);
35 gfx::Canvas canvas(size, 1.0f, true); 36 gfx::Canvas canvas(size, 1.0f, true);
36 scoped_ptr<views::Painter> painter( 37 scoped_ptr<views::Painter> painter(
37 views::Painter::CreateVerticalGradient(SK_ColorBLUE, SK_ColorCYAN)); 38 views::Painter::CreateVerticalGradient(SK_ColorBLUE, SK_ColorCYAN));
38 painter->Paint(&canvas, size); 39 painter->Paint(&canvas, size);
39 athena::ScreenManager::Get()->SetBackgroundImage( 40 athena::ScreenManager::Get()->SetBackgroundImage(
40 gfx::ImageSkia(canvas.ExtractImageRep())); 41 gfx::ImageSkia(canvas.ExtractImageRep()));
41 } 42 }
OLDNEW
« no previous file with comments | « athena/main/athena_main.cc ('k') | athena/screen/public/screen_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698