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

Unified Diff: chrome/browser/ui/views/extensions/shell_window_views.cc

Issue 9030017: Implement ShellWindow in Views. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 12 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 | « chrome/browser/ui/views/extensions/shell_window_views.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « chrome/browser/ui/views/extensions/shell_window_views.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698