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

Unified Diff: views/aura_desktop/aura_desktop_main.cc

Issue 7744045: Show a Window in the aura views demo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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 | « no previous file | views/views.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/aura_desktop/aura_desktop_main.cc
===================================================================
--- views/aura_desktop/aura_desktop_main.cc (revision 98331)
+++ views/aura_desktop/aura_desktop_main.cc (working copy)
@@ -18,6 +18,7 @@
#include "ui/gfx/canvas_skia.h"
#include "ui/gfx/rect.h"
#include "views/widget/widget.h"
+#include "views/widget/widget_delegate.h"
namespace {
@@ -50,6 +51,28 @@
DISALLOW_COPY_AND_ASSIGN(TestView);
};
+class TestWindowContents : public views::WidgetDelegateView {
+ public:
+ TestWindowContents() {}
+ virtual ~TestWindowContents() {}
+
+ private:
+ // Overridden from views::View:
+ virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
+ canvas->FillRectInt(SK_ColorGRAY, 0, 0, width(), height());
+ }
+
+ // Overridden from views::WidgetDelegateView:
+ virtual std::wstring GetWindowTitle() const OVERRIDE {
+ return L"Test Window!";
+ }
+ virtual View* GetContentsView() OVERRIDE {
+ return this;
+ }
+
+ DISALLOW_COPY_AND_ASSIGN(TestWindowContents);
+};
+
} // namespace
int main(int argc, char** argv) {
@@ -100,6 +123,11 @@
widget.Init(params);
widget.SetContentsView(new TestView);
+ TestWindowContents* contents = new TestWindowContents;
+ views::Widget* views_window = views::Widget::CreateWindowWithParentAndBounds(
+ contents, &window2, gfx::Rect(120, 150, 200, 200));
+ views_window->Show();
+
aura::Desktop::GetInstance()->Run();
return 0;
}
« no previous file with comments | « no previous file | views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698