OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/extensions/shell_window_views.h" | 5 #include "chrome/browser/ui/views/extensions/shell_window_views.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/extensions/extension_host.h" | 8 #include "chrome/browser/extensions/extension_host.h" |
9 #include "chrome/common/extensions/extension.h" | 9 #include "chrome/common/extensions/extension.h" |
10 #include "content/public/browser/render_view_host.h" | 10 #include "content/public/browser/render_view_host.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 return HTBOTTOM; | 92 return HTBOTTOM; |
93 return HTCAPTION; | 93 return HTCAPTION; |
94 } | 94 } |
95 | 95 |
96 void ShellWindowFrameView::GetWindowMask(const gfx::Size& size, | 96 void ShellWindowFrameView::GetWindowMask(const gfx::Size& size, |
97 gfx::Path* window_mask) { | 97 gfx::Path* window_mask) { |
98 // Don't touch it. | 98 // Don't touch it. |
99 } | 99 } |
100 | 100 |
101 ShellWindowViews::ShellWindowViews(Profile* profile, | 101 ShellWindowViews::ShellWindowViews(Profile* profile, |
102 const Extension* extension, | 102 const extensions::Extension* extension, |
103 const GURL& url) | 103 const GURL& url) |
104 : ShellWindow(profile, extension, url), | 104 : ShellWindow(profile, extension, url), |
105 initialized_(false) { | 105 initialized_(false) { |
106 window_ = new views::Widget; | 106 window_ = new views::Widget; |
107 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); | 107 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); |
108 params.delegate = this; | 108 params.delegate = this; |
109 params.remove_standard_frame = true; | 109 params.remove_standard_frame = true; |
110 gfx::Rect bounds(10, 10, kDefaultWidth, kDefaultHeight); | 110 gfx::Rect bounds(10, 10, kDefaultWidth, kDefaultHeight); |
111 params.bounds = bounds; | 111 params.bounds = bounds; |
112 window_->Init(params); | 112 window_->Init(params); |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 // We can't send size zero because RenderWidget DCHECKs that. | 336 // We can't send size zero because RenderWidget DCHECKs that. |
337 content::RenderViewHost* rvh = web_contents()->GetRenderViewHost(); | 337 content::RenderViewHost* rvh = web_contents()->GetRenderViewHost(); |
338 if (rvh->GetView() && !bounds().IsEmpty()) { | 338 if (rvh->GetView() && !bounds().IsEmpty()) { |
339 rvh->GetView()->SetSize(size()); | 339 rvh->GetView()->SetSize(size()); |
340 OnViewWasResized(); | 340 OnViewWasResized(); |
341 } | 341 } |
342 } | 342 } |
343 | 343 |
344 // static | 344 // static |
345 ShellWindow* ShellWindow::CreateImpl(Profile* profile, | 345 ShellWindow* ShellWindow::CreateImpl(Profile* profile, |
346 const Extension* extension, | 346 const extensions::Extension* extension, |
347 const GURL& url) { | 347 const GURL& url) { |
348 return new ShellWindowViews(profile, extension, url); | 348 return new ShellWindowViews(profile, extension, url); |
349 } | 349 } |
OLD | NEW |