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/native_app_window_views.h" | 5 #include "chrome/browser/ui/views/extensions/native_app_window_views.h" |
6 | 6 |
7 #include "chrome/browser/extensions/extension_host.h" | 7 #include "chrome/browser/extensions/extension_host.h" |
8 #include "chrome/browser/favicon/favicon_tab_helper.h" | 8 #include "chrome/browser/favicon/favicon_tab_helper.h" |
9 #include "chrome/browser/ui/views/extensions/extension_keybinding_registry_views
.h" | 9 #include "chrome/browser/ui/views/extensions/extension_keybinding_registry_views
.h" |
10 #include "chrome/browser/ui/views/extensions/shell_window_frame_view.h" | 10 #include "chrome/browser/ui/views/extensions/shell_window_frame_view.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 NativeAppWindowViews::~NativeAppWindowViews() { | 72 NativeAppWindowViews::~NativeAppWindowViews() { |
73 web_view_->SetWebContents(NULL); | 73 web_view_->SetWebContents(NULL); |
74 } | 74 } |
75 | 75 |
76 void NativeAppWindowViews::InitializeDefaultWindow( | 76 void NativeAppWindowViews::InitializeDefaultWindow( |
77 const ShellWindow::CreateParams& create_params) { | 77 const ShellWindow::CreateParams& create_params) { |
78 views::Widget::InitParams init_params(views::Widget::InitParams::TYPE_WINDOW); | 78 views::Widget::InitParams init_params(views::Widget::InitParams::TYPE_WINDOW); |
79 init_params.delegate = this; | 79 init_params.delegate = this; |
80 init_params.remove_standard_frame = true; | 80 init_params.remove_standard_frame = true; |
81 init_params.use_system_default_icon = true; | 81 init_params.use_system_default_icon = true; |
| 82 // TODO(erg): Conceptually, these are toplevel windows, but we theoretically |
| 83 // could plumb context through to here in some cases. |
| 84 init_params.top_level = true; |
82 window_->Init(init_params); | 85 window_->Init(init_params); |
83 gfx::Rect window_bounds = create_params.bounds; | 86 gfx::Rect window_bounds = create_params.bounds; |
84 window_bounds.Inset(-GetFrameInsets()); | 87 window_bounds.Inset(-GetFrameInsets()); |
85 // Center window if no position was specified. | 88 // Center window if no position was specified. |
86 if (create_params.bounds.x() == INT_MIN || | 89 if (create_params.bounds.x() == INT_MIN || |
87 create_params.bounds.y() == INT_MIN) { | 90 create_params.bounds.y() == INT_MIN) { |
88 window_->CenterWindow(window_bounds.size()); | 91 window_->CenterWindow(window_bounds.size()); |
89 } else { | 92 } else { |
90 window_->SetBounds(window_bounds); | 93 window_->SetBounds(window_bounds); |
91 } | 94 } |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 } | 498 } |
496 | 499 |
497 //------------------------------------------------------------------------------ | 500 //------------------------------------------------------------------------------ |
498 // NativeAppWindow::Create | 501 // NativeAppWindow::Create |
499 | 502 |
500 // static | 503 // static |
501 NativeAppWindow* NativeAppWindow::Create( | 504 NativeAppWindow* NativeAppWindow::Create( |
502 ShellWindow* shell_window, const ShellWindow::CreateParams& params) { | 505 ShellWindow* shell_window, const ShellWindow::CreateParams& params) { |
503 return new NativeAppWindowViews(shell_window, params); | 506 return new NativeAppWindowViews(shell_window, params); |
504 } | 507 } |
OLD | NEW |