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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « athena/main/placeholder.h ('k') | athena/screen/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/main/placeholder.cc
diff --git a/athena/main/placeholder.cc b/athena/main/placeholder.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0b0d359b3d7c5bbd9bdd7b85bc29e3e900b32a45
--- /dev/null
+++ b/athena/main/placeholder.cc
@@ -0,0 +1,41 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "athena/main/placeholder.h"
+
+#include "athena/screen/public/screen_manager.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/strings/utf_string_conversions.h"
+#include "third_party/skia/include/core/SkColor.h"
+#include "ui/gfx/canvas.h"
+#include "ui/gfx/image/image_skia.h"
+#include "ui/views/background.h"
+#include "ui/views/controls/label.h"
+#include "ui/views/painter.h"
+#include "ui/views/widget/widget.h"
+
+void CreateTestWindows() {
+ views::Widget* test_app_widget = new views::Widget;
+ // Athena doesn't have frame yet.
+ views::Widget::InitParams params(
+ views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
+ params.context = athena::ScreenManager::Get()->GetContext();
+ test_app_widget->Init(params);
+ views::Label* label = new views::Label;
+ label->SetText(base::ASCIIToUTF16("AppWindow"));
+ label->set_background(
+ views::Background::CreateSolidBackground(SK_ColorWHITE));
+ test_app_widget->SetContentsView(label);
+ test_app_widget->Show();
+}
+
+void SetupBackgroundImage() {
+ gfx::Size size(200, 200);
+ gfx::Canvas canvas(size, 1.0f, true);
+ scoped_ptr<views::Painter> painter(
+ views::Painter::CreateVerticalGradient(SK_ColorBLUE, SK_ColorCYAN));
+ painter->Paint(&canvas, size);
+ athena::ScreenManager::Get()->SetBackgroundImage(
+ gfx::ImageSkia(canvas.ExtractImageRep()));
+}
« 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