diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-22 20:17:01 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-22 20:17:01 +0000 |
commit | ca9c23002e3e9d6325e6bddae60341f67dd4f460 (patch) | |
tree | d687c041da38970a6872e6b2e0c6543b083f01dd /ash/shell/toplevel_window.cc | |
parent | 240502342713279f648c1b21a889e52d19b91ff1 (diff) | |
download | chromium_src-ca9c23002e3e9d6325e6bddae60341f67dd4f460.zip chromium_src-ca9c23002e3e9d6325e6bddae60341f67dd4f460.tar.gz chromium_src-ca9c23002e3e9d6325e6bddae60341f67dd4f460.tar.bz2 |
Create the new toplevel directory ash, and move the shell examples in it as a seed.
Examples are now known as "shell". (I will rename aura_shell::Shell to something else in a pending CL).
http://crbug.com/108457
TEST=none
TBR=sky
Review URL: http://codereview.chromium.org/9026012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115588 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shell/toplevel_window.cc')
-rw-r--r-- | ash/shell/toplevel_window.cc | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/ash/shell/toplevel_window.cc b/ash/shell/toplevel_window.cc new file mode 100644 index 0000000..ba0e931 --- /dev/null +++ b/ash/shell/toplevel_window.cc @@ -0,0 +1,61 @@ +// Copyright (c) 2011 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 "ash/shell/toplevel_window.h" + +#include "base/utf_string_conversions.h" +#include "ui/aura/window.h" +#include "ui/aura_shell/toplevel_frame_view.h" +#include "ui/gfx/canvas.h" +#include "ui/views/widget/widget.h" + +namespace ash { +namespace shell { + +ToplevelWindow::CreateParams::CreateParams() + : can_resize(false), + can_maximize(false) { +} + +// static +void ToplevelWindow::CreateToplevelWindow(const CreateParams& params) { + views::Widget* widget = + views::Widget::CreateWindowWithBounds(new ToplevelWindow(params), + gfx::Rect(120, 150, 400, 300)); + widget->GetNativeView()->SetName("Examples:ToplevelWindow"); + widget->Show(); +} + +ToplevelWindow::ToplevelWindow(const CreateParams& params) : params_(params) { +} + +ToplevelWindow::~ToplevelWindow() { +} + +void ToplevelWindow::OnPaint(gfx::Canvas* canvas) { + canvas->FillRect(SK_ColorDKGRAY, GetLocalBounds()); +} + +string16 ToplevelWindow::GetWindowTitle() const { + return ASCIIToUTF16("Examples: Toplevel Window"); +} + +views::View* ToplevelWindow::GetContentsView() { + return this; +} + +bool ToplevelWindow::CanResize() const { + return params_.can_resize; +} + +bool ToplevelWindow::CanMaximize() const { + return params_.can_maximize; +} + +views::NonClientFrameView* ToplevelWindow::CreateNonClientFrameView() { + return new aura_shell::internal::ToplevelFrameView; +} + +} // namespace shell +} // namespace ash |