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 100644 |
| index 0000000000000000000000000000000000000000..2d1ba2111d2f354fb6cb95ffa6e02fbd71128ad4 |
| --- /dev/null |
| +++ b/chrome/browser/ui/views/extensions/shell_window_views.cc |
| @@ -0,0 +1,65 @@ |
| +// 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 "base/utf_string_conversions.h" |
| +#include "chrome/browser/extensions/extension_host.h" |
| +#include "chrome/common/extensions/extension.h" |
| +#include "content/browser/renderer_host/render_widget_host_view_win.h" |
| +#include "ui/gfx/canvas_skia.h" |
|
Mihai Parparita -not on Chrome
2012/01/12 02:09:09
This seems unused.
jeremya
2012/01/12 18:28:46
Done.
|
| +#include "ui/gfx/path.h" |
| +#include "ui/views/widget/widget.h" |
| + |
| +void GetContentsMask(const gfx::Rect& rect, gfx::Path* path); |
|
Mihai Parparita -not on Chrome
2012/01/12 02:09:09
I think this can be deleted.
jeremya
2012/01/12 18:28:46
Done.
|
| + |
| +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.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 this; |
|
Mihai Parparita -not on Chrome
2012/01/12 02:09:09
Will this close the window?
jeremya
2012/01/12 18:28:46
Nope. Good catch.
|
| +} |
| + |
| +void ShellWindowViews::DeleteDelegate() { |
| + Close(); |
| +} |
| + |
| +bool ShellWindowViews::CanResize() const { |
| + return true; |
| +} |
| + |
| +views::View* ShellWindowViews::GetContentsView() { |
| + return host_->view(); |
| +} |
| + |
| +string16 ShellWindowViews::GetWindowTitle() const { |
| + return UTF8ToUTF16(host_->extension()->name()); |
| +} |
| + |
| +views::Widget* ShellWindowViews::GetWidget() { |
| + return window_; |
| +} |
| +const views::Widget* ShellWindowViews::GetWidget() const { |
|
Mihai Parparita -not on Chrome
2012/01/12 02:09:09
Add a newline between functions..
jeremya
2012/01/12 18:28:46
Done.
|
| + return window_; |
| +} |
| + |
| +// static |
| +ShellWindow* ShellWindow::CreateShellWindow(ExtensionHost* host) { |
| + return new ShellWindowViews(host); |
| +} |