Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/apps/native_app_window_views.h" | 5 #include "chrome/browser/ui/views/apps/native_app_window_views.h" |
| 6 | 6 |
| 7 #include "apps/shell_window.h" | 7 #include "apps/shell_window.h" |
| 8 #include "apps/ui/views/shell_window_frame_view.h" | 8 #include "apps/ui/views/shell_window_frame_view.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 280 .Append(web_app::internals::GetSanitizedFileName(shortcut_info.title)) | 280 .Append(web_app::internals::GetSanitizedFileName(shortcut_info.title)) |
| 281 .ReplaceExtension(FILE_PATH_LITERAL(".ico")); | 281 .ReplaceExtension(FILE_PATH_LITERAL(".ico")); |
| 282 | 282 |
| 283 content::BrowserThread::PostBlockingPoolTask( | 283 content::BrowserThread::PostBlockingPoolTask( |
| 284 FROM_HERE, | 284 FROM_HERE, |
| 285 base::Bind(&CreateIconAndSetRelaunchDetails, | 285 base::Bind(&CreateIconAndSetRelaunchDetails, |
| 286 web_app_path, icon_file, shortcut_info, hwnd)); | 286 web_app_path, icon_file, shortcut_info, hwnd)); |
| 287 } | 287 } |
| 288 | 288 |
| 289 HWND NativeAppWindowViews::GetNativeAppWindowHWND() const { | 289 HWND NativeAppWindowViews::GetNativeAppWindowHWND() const { |
| 290 return views::HWNDForWidget(GetWidget()->GetTopLevelWidget()); | 290 return views::HWNDForWidget(GetWidget()->GetTopLevelWidget()); |
|
benwells
2013/11/05 11:29:07
For consistency may as well change this one too.
| |
| 291 } | 291 } |
| 292 #endif | 292 #endif |
| 293 | 293 |
| 294 void NativeAppWindowViews::InitializePanelWindow( | 294 void NativeAppWindowViews::InitializePanelWindow( |
| 295 const ShellWindow::CreateParams& create_params) { | 295 const ShellWindow::CreateParams& create_params) { |
| 296 views::Widget::InitParams params(views::Widget::InitParams::TYPE_PANEL); | 296 views::Widget::InitParams params(views::Widget::InitParams::TYPE_PANEL); |
| 297 params.delegate = this; | 297 params.delegate = this; |
| 298 | 298 |
| 299 preferred_size_ = gfx::Size(create_params.bounds.width(), | 299 preferred_size_ = gfx::Size(create_params.bounds.width(), |
| 300 create_params.bounds.height()); | 300 create_params.bounds.height()); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 470 | 470 |
| 471 void NativeAppWindowViews::Minimize() { | 471 void NativeAppWindowViews::Minimize() { |
| 472 window_->Minimize(); | 472 window_->Minimize(); |
| 473 } | 473 } |
| 474 | 474 |
| 475 void NativeAppWindowViews::Restore() { | 475 void NativeAppWindowViews::Restore() { |
| 476 window_->Restore(); | 476 window_->Restore(); |
| 477 } | 477 } |
| 478 | 478 |
| 479 void NativeAppWindowViews::SetBounds(const gfx::Rect& bounds) { | 479 void NativeAppWindowViews::SetBounds(const gfx::Rect& bounds) { |
| 480 GetWidget()->SetBounds(bounds); | 480 window_->SetBounds(bounds); |
| 481 } | 481 } |
| 482 | 482 |
| 483 void NativeAppWindowViews::FlashFrame(bool flash) { | 483 void NativeAppWindowViews::FlashFrame(bool flash) { |
| 484 window_->FlashFrame(flash); | 484 window_->FlashFrame(flash); |
| 485 } | 485 } |
| 486 | 486 |
| 487 bool NativeAppWindowViews::IsAlwaysOnTop() const { | 487 bool NativeAppWindowViews::IsAlwaysOnTop() const { |
| 488 if (shell_window_->window_type_is_panel()) { | 488 if (shell_window_->window_type_is_panel()) { |
| 489 #if defined(USE_ASH) | 489 #if defined(USE_ASH) |
| 490 return ash::wm::GetWindowState(window_->GetNativeWindow())-> | 490 return ash::wm::GetWindowState(window_->GetNativeWindow())-> |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 867 gfx::Rect client_bounds = gfx::Rect(1000, 1000); | 867 gfx::Rect client_bounds = gfx::Rect(1000, 1000); |
| 868 gfx::Rect window_bounds = | 868 gfx::Rect window_bounds = |
| 869 window_->non_client_view()->GetWindowBoundsForClientBounds( | 869 window_->non_client_view()->GetWindowBoundsForClientBounds( |
| 870 client_bounds); | 870 client_bounds); |
| 871 return window_bounds.InsetsFrom(client_bounds); | 871 return window_bounds.InsetsFrom(client_bounds); |
| 872 } | 872 } |
| 873 | 873 |
| 874 void NativeAppWindowViews::HideWithApp() {} | 874 void NativeAppWindowViews::HideWithApp() {} |
| 875 void NativeAppWindowViews::ShowWithApp() {} | 875 void NativeAppWindowViews::ShowWithApp() {} |
| 876 void NativeAppWindowViews::UpdateWindowMinMaxSize() {} | 876 void NativeAppWindowViews::UpdateWindowMinMaxSize() {} |
| OLD | NEW |