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

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

Issue 287163009: [Athena] minimum impl to add screen/background and test windows (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/placeholder.h ('k') | athena/screen/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "athena/main/placeholder.h"
6
7 #include "athena/screen/public/screen_manager.h"
8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/utf_string_conversions.h"
10 #include "third_party/skia/include/core/SkColor.h"
11 #include "ui/gfx/canvas.h"
12 #include "ui/gfx/image/image_skia.h"
13 #include "ui/views/background.h"
14 #include "ui/views/controls/label.h"
15 #include "ui/views/painter.h"
16 #include "ui/views/widget/widget.h"
17
18 void CreateTestWindows() {
19 views::Widget* test_app_widget = new views::Widget;
20 // Athena doesn't have frame yet.
21 views::Widget::InitParams params(
22 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
23 params.context = athena::ScreenManager::Get()->GetContext();
24 test_app_widget->Init(params);
25 views::Label* label = new views::Label;
26 label->SetText(base::ASCIIToUTF16("AppWindow"));
27 label->set_background(
28 views::Background::CreateSolidBackground(SK_ColorWHITE));
29 test_app_widget->SetContentsView(label);
30 test_app_widget->Show();
31 }
32
33 void SetupBackgroundImage() {
34 gfx::Size size(200, 200);
35 gfx::Canvas canvas(size, 1.0f, true);
36 scoped_ptr<views::Painter> painter(
37 views::Painter::CreateVerticalGradient(SK_ColorBLUE, SK_ColorCYAN));
38 painter->Paint(&canvas, size);
39 athena::ScreenManager::Get()->SetBackgroundImage(
40 gfx::ImageSkia(canvas.ExtractImageRep()));
41 }
OLDNEW
« no previous file with comments | « athena/main/placeholder.h ('k') | athena/screen/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698