Index: athena/main/main_util.cc |
diff --git a/athena/main/main_util.cc b/athena/main/main_util.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a23c39d4b2fa6fa34a237f167a76375032b5c6db |
--- /dev/null |
+++ b/athena/main/main_util.cc |
@@ -0,0 +1,41 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
Albert Bodenhamer
2014/05/16 20:11:24
Looks like main_util is just placeholder stuff?
oshima
2014/05/16 20:14:13
Yes, this is just a dummy impl until we have real
Albert Bodenhamer
2014/05/16 20:22:20
Perhaps. When I see a file named "main_util.h/cc"
oshima
2014/05/16 22:26:33
renamed to just placeholder.h/cc as it does a bit
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "athena/main/main_util.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 CreateTestApp() { |
+ 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())); |
+} |