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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 NativeAppWindowViews::~NativeAppWindowViews() { | 70 NativeAppWindowViews::~NativeAppWindowViews() { |
71 web_view_->SetWebContents(NULL); | 71 web_view_->SetWebContents(NULL); |
72 } | 72 } |
73 | 73 |
74 void NativeAppWindowViews::InitializeDefaultWindow( | 74 void NativeAppWindowViews::InitializeDefaultWindow( |
75 const ShellWindow::CreateParams& create_params) { | 75 const ShellWindow::CreateParams& create_params) { |
76 views::Widget::InitParams init_params(views::Widget::InitParams::TYPE_WINDOW); | 76 views::Widget::InitParams init_params(views::Widget::InitParams::TYPE_WINDOW); |
77 init_params.delegate = this; | 77 init_params.delegate = this; |
78 init_params.remove_standard_frame = true; | 78 init_params.remove_standard_frame = true; |
79 init_params.use_system_default_icon = true; | 79 init_params.use_system_default_icon = true; |
| 80 // TODO(erg): Conceptually, these are toplevel windows, but we theoretically |
| 81 // could plumb context through to here in some cases. |
| 82 init_params.top_level = true; |
80 window_->Init(init_params); | 83 window_->Init(init_params); |
81 gfx::Rect window_bounds = create_params.bounds; | 84 gfx::Rect window_bounds = create_params.bounds; |
82 window_bounds.Inset(-GetFrameInsets()); | 85 window_bounds.Inset(-GetFrameInsets()); |
83 // Center window if no position was specified. | 86 // Center window if no position was specified. |
84 if (create_params.bounds.x() == INT_MIN || | 87 if (create_params.bounds.x() == INT_MIN || |
85 create_params.bounds.y() == INT_MIN) { | 88 create_params.bounds.y() == INT_MIN) { |
86 window_->CenterWindow(window_bounds.size()); | 89 window_->CenterWindow(window_bounds.size()); |
87 } else { | 90 } else { |
88 window_->SetBounds(window_bounds); | 91 window_->SetBounds(window_bounds); |
89 } | 92 } |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 } | 479 } |
477 | 480 |
478 //------------------------------------------------------------------------------ | 481 //------------------------------------------------------------------------------ |
479 // NativeAppWindow::Create | 482 // NativeAppWindow::Create |
480 | 483 |
481 // static | 484 // static |
482 NativeAppWindow* NativeAppWindow::Create( | 485 NativeAppWindow* NativeAppWindow::Create( |
483 ShellWindow* shell_window, const ShellWindow::CreateParams& params) { | 486 ShellWindow* shell_window, const ShellWindow::CreateParams& params) { |
484 return new NativeAppWindowViews(shell_window, params); | 487 return new NativeAppWindowViews(shell_window, params); |
485 } | 488 } |
OLD | NEW |