Chromium Code Reviews| Index: chrome/browser/ui/views/extensions/native_app_window_views.cc |
| diff --git a/chrome/browser/ui/views/extensions/native_app_window_views.cc b/chrome/browser/ui/views/extensions/native_app_window_views.cc |
| index 6fcc6ea86a3a613e2ca4de9599ac6372f6cc31c4..5d09c364a908f433a8d929a64949ed69722dd85f 100644 |
| --- a/chrome/browser/ui/views/extensions/native_app_window_views.cc |
| +++ b/chrome/browser/ui/views/extensions/native_app_window_views.cc |
| @@ -56,11 +56,12 @@ NativeAppWindowViews::NativeAppWindowViews( |
| maximum_size_ = create_params.maximum_size; |
| window_ = new views::Widget; |
| - if (create_params.window_type == ShellWindow::WINDOW_TYPE_PANEL) |
| + if (create_params.window_type == ShellWindow::WINDOW_TYPE_PANEL || |
| + create_params.window_type == ShellWindow::WINDOW_TYPE_V1_PANEL) { |
| InitializePanelWindow(create_params); |
| - else |
| + } else { |
| InitializeDefaultWindow(create_params); |
| - |
| + } |
| extension_keybinding_registry_.reset( |
| new ExtensionKeybindingRegistryViews( |
| profile(), |
| @@ -145,10 +146,12 @@ void NativeAppWindowViews::InitializePanelWindow( |
| // the exact location and size, but this doesn't work well |
| // on non-ash environment where we don't have full control over |
| // window management. |
| - gfx::Rect window_bounds = |
| - window_->non_client_view()->GetWindowBoundsForClientBounds( |
| - create_params.bounds); |
| - window_->SetBounds(window_bounds); |
| + if (ash::Shell::HasInstance()) { |
|
jeremya
2013/02/15 03:28:16
not sure I understand this -- won't the 'ash' name
stevenjb
2013/02/15 18:26:35
This was a mistake and will be removed.
|
| + gfx::Rect window_bounds = |
| + window_->non_client_view()->GetWindowBoundsForClientBounds( |
| + create_params.bounds); |
| + window_->SetBounds(window_bounds); |
| + } |
| #endif |
| } |
| @@ -234,7 +237,7 @@ void NativeAppWindowViews::FlashFrame(bool flash) { |
| } |
| bool NativeAppWindowViews::IsAlwaysOnTop() const { |
| - return shell_window_->window_type() == ShellWindow::WINDOW_TYPE_PANEL; |
| + return shell_window_->window_type_panel(); |
| } |
| gfx::Insets NativeAppWindowViews::GetFrameInsets() const { |
| @@ -330,7 +333,7 @@ string16 NativeAppWindowViews::GetWindowTitle() const { |
| } |
| bool NativeAppWindowViews::ShouldShowWindowTitle() const { |
| - return false; |
| + return shell_window_->window_type() == ShellWindow::WINDOW_TYPE_V1_PANEL; |
|
jeremya
2013/02/15 03:28:16
This class is getting pretty tangly :(
stevenjb
2013/02/15 18:26:35
I wasn't in favor of doing the hack, but we decide
|
| } |
| gfx::ImageSkia NativeAppWindowViews::GetWindowAppIcon() { |
| @@ -353,6 +356,10 @@ gfx::ImageSkia NativeAppWindowViews::GetWindowIcon() { |
| return gfx::ImageSkia(); |
| } |
| +bool NativeAppWindowViews::ShouldShowWindowIcon() const { |
| + return shell_window_->window_type() == ShellWindow::WINDOW_TYPE_V1_PANEL; |
|
jeremya
2013/02/15 03:28:16
What does this do on Windows (or do we never creat
stevenjb
2013/02/15 18:26:35
We won't create V1_PANEL on Windows. That scenario
|
| +} |
| + |
| void NativeAppWindowViews::SaveWindowPlacement(const gfx::Rect& bounds, |
| ui::WindowShowState show_state) { |
| views::WidgetDelegate::SaveWindowPlacement(bounds, show_state); |
| @@ -376,7 +383,7 @@ views::NonClientFrameView* NativeAppWindowViews::CreateNonClientFrameView( |
| views::Widget* widget) { |
| #if defined(USE_ASH) |
| if (chrome::IsNativeViewInAsh(widget->GetNativeView())) { |
| - if (shell_window_->window_type() == ShellWindow::WINDOW_TYPE_PANEL) { |
| + if (shell_window_->window_type_panel()) { |
| ash::PanelFrameView::FrameType frame_type = frameless_ ? |
| ash::PanelFrameView::FRAME_NONE : ash::PanelFrameView::FRAME_ASH; |
| return new ash::PanelFrameView(widget, frame_type); |
| @@ -476,7 +483,7 @@ void NativeAppWindowViews::OnFocus() { |
| void NativeAppWindowViews::SetFullscreen(bool fullscreen) { |
| // Fullscreen not supported by panels. |
| - if (shell_window_->window_type() == ShellWindow::WINDOW_TYPE_PANEL) |
| + if (shell_window_->window_type_panel()) |
| return; |
| is_fullscreen_ = fullscreen; |
| window_->SetFullscreen(fullscreen); |