Chromium Code Reviews| Index: chrome/browser/ui/views/extensions/shell_window_views.cc |
| diff --git a/chrome/browser/ui/views/extensions/shell_window_views.cc b/chrome/browser/ui/views/extensions/shell_window_views.cc |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..11d3e86457770746de6a49d3f3746153ccc9733e |
| --- /dev/null |
| +++ b/chrome/browser/ui/views/extensions/shell_window_views.cc |
| @@ -0,0 +1,46 @@ |
| +// 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 "chrome/browser/ui/views/extensions/shell_window_views.h" |
| + |
| +#include "chrome/browser/extensions/extension_host.h" |
| +#include "content/browser/renderer_host/render_widget_host_view_win.h" |
| +#include "ui/views/widget/widget.h" |
| + |
| +ShellWindowViews::ShellWindowViews(ExtensionHost* host) |
| + : ShellWindow(host) { |
| + host_->view()->SetContainer(this); |
| + window_ = new views::Widget; |
| + views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); |
| + params.can_activate = true; |
| + params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| + params.parent = NULL; |
| + params.delegate = this; |
| + gfx::Rect bounds(0, 0, 512, 384); |
| + params.bounds = bounds; |
| + params.top_level = true; |
| + window_->Init(params); |
| + window_->Show(); |
| +} |
| + |
| +ShellWindowViews::~ShellWindowViews() { |
| +} |
| + |
| +void ShellWindowViews::Close() { |
| + delete window_; // TODO(jeremya): is this the right way to destroy a Widget? |
| + delete this; |
| +} |
| + |
| +views::View* ShellWindowViews::GetContentsView() { |
| + return host_->view(); |
| +} |
| + |
| +views::Widget* ShellWindowViews::GetWidget() { |
| + return window_; |
| +} |
| +const views::Widget* ShellWindowViews::GetWidget() const { |
| + return window_; |
| +} |
| + |
| +// TODO(jeremya): destroy when window closes? |
|
Mihai Parparita -not on Chrome
2012/01/06 23:26:50
I think you'll want to override DeleteDelegate and
jeremya
2012/01/12 01:46:04
Done.
|