Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/ui/views/extensions/shell_window_views.h" | |
| 6 | |
| 7 #include "base/utf_string_conversions.h" | |
| 8 #include "chrome/browser/extensions/extension_host.h" | |
| 9 #include "chrome/common/extensions/extension.h" | |
| 10 #include "content/browser/renderer_host/render_widget_host_view_win.h" | |
| 11 #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.
| |
| 12 #include "ui/gfx/path.h" | |
| 13 #include "ui/views/widget/widget.h" | |
| 14 | |
| 15 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.
| |
| 16 | |
| 17 ShellWindowViews::ShellWindowViews(ExtensionHost* host) | |
| 18 : ShellWindow(host) { | |
| 19 host_->view()->SetContainer(this); | |
| 20 window_ = new views::Widget; | |
| 21 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); | |
| 22 params.can_activate = true; | |
| 23 params.parent = NULL; | |
| 24 params.delegate = this; | |
| 25 gfx::Rect bounds(0, 0, 512, 384); | |
| 26 params.bounds = bounds; | |
| 27 params.top_level = true; | |
| 28 window_->Init(params); | |
| 29 window_->Show(); | |
| 30 } | |
| 31 | |
| 32 ShellWindowViews::~ShellWindowViews() { | |
| 33 } | |
| 34 | |
| 35 void ShellWindowViews::Close() { | |
| 36 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.
| |
| 37 } | |
| 38 | |
| 39 void ShellWindowViews::DeleteDelegate() { | |
| 40 Close(); | |
| 41 } | |
| 42 | |
| 43 bool ShellWindowViews::CanResize() const { | |
| 44 return true; | |
| 45 } | |
| 46 | |
| 47 views::View* ShellWindowViews::GetContentsView() { | |
| 48 return host_->view(); | |
| 49 } | |
| 50 | |
| 51 string16 ShellWindowViews::GetWindowTitle() const { | |
| 52 return UTF8ToUTF16(host_->extension()->name()); | |
| 53 } | |
| 54 | |
| 55 views::Widget* ShellWindowViews::GetWidget() { | |
| 56 return window_; | |
| 57 } | |
| 58 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.
| |
| 59 return window_; | |
| 60 } | |
| 61 | |
| 62 // static | |
| 63 ShellWindow* ShellWindow::CreateShellWindow(ExtensionHost* host) { | |
| 64 return new ShellWindowViews(host); | |
| 65 } | |
| OLD | NEW |