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 use_native_frame_(true) { | 106 use_native_frame_(true) { |
107 window_ = new views::Widget; | 107 window_ = new views::Widget; |
108 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); | 108 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); |
109 params.delegate = this; | 109 params.delegate = this; |
110 params.remove_standard_frame = !use_native_frame_; | 110 params.remove_standard_frame = !use_native_frame_; |
111 gfx::Rect bounds(10, 10, kDefaultWidth, kDefaultHeight); | 111 gfx::Rect bounds(10, 10, kDefaultWidth, kDefaultHeight); |
112 params.bounds = bounds; | 112 params.bounds = bounds; |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 // We can't send size zero because RenderWidget DCHECKs that. | 341 // We can't send size zero because RenderWidget DCHECKs that. |
342 content::RenderViewHost* rvh = web_contents()->GetRenderViewHost(); | 342 content::RenderViewHost* rvh = web_contents()->GetRenderViewHost(); |
343 if (rvh->GetView() && !bounds().IsEmpty()) { | 343 if (rvh->GetView() && !bounds().IsEmpty()) { |
344 rvh->GetView()->SetSize(size()); | 344 rvh->GetView()->SetSize(size()); |
345 OnViewWasResized(); | 345 OnViewWasResized(); |
346 } | 346 } |
347 } | 347 } |
348 | 348 |
349 // static | 349 // static |
350 ShellWindow* ShellWindow::CreateImpl(Profile* profile, | 350 ShellWindow* ShellWindow::CreateImpl(Profile* profile, |
351 const Extension* extension, | 351 const extensions::Extension* extension, |
352 const GURL& url) { | 352 const GURL& url) { |
353 return new ShellWindowViews(profile, extension, url); | 353 return new ShellWindowViews(profile, extension, url); |
354 } | 354 } |
OLD | NEW |