| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "apps/ui/views/native_app_window_views.h" | 5 #include "components/native_app_window/native_app_window_views.h" |
| 6 | 6 |
| 7 #include "base/threading/sequenced_worker_pool.h" | 7 #include "base/threading/sequenced_worker_pool.h" |
| 8 #include "content/public/browser/render_view_host.h" | 8 #include "content/public/browser/render_view_host.h" |
| 9 #include "content/public/browser/render_widget_host_view.h" | 9 #include "content/public/browser/render_widget_host_view.h" |
| 10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
| 11 #include "extensions/browser/app_window/app_window.h" | 11 #include "extensions/browser/app_window/app_window.h" |
| 12 #include "extensions/common/draggable_region.h" | 12 #include "extensions/common/draggable_region.h" |
| 13 #include "third_party/skia/include/core/SkRegion.h" | 13 #include "third_party/skia/include/core/SkRegion.h" |
| 14 #include "ui/gfx/path.h" | 14 #include "ui/gfx/path.h" |
| 15 #include "ui/views/controls/webview/webview.h" | 15 #include "ui/views/controls/webview/webview.h" |
| 16 #include "ui/views/widget/widget.h" | 16 #include "ui/views/widget/widget.h" |
| 17 #include "ui/views/window/non_client_view.h" | 17 #include "ui/views/window/non_client_view.h" |
| 18 | 18 |
| 19 #if defined(USE_AURA) | 19 #if defined(USE_AURA) |
| 20 #include "ui/aura/window.h" | 20 #include "ui/aura/window.h" |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 using extensions::AppWindow; | 23 namespace extensions { |
| 24 | |
| 25 namespace apps { | |
| 26 | 24 |
| 27 NativeAppWindowViews::NativeAppWindowViews() | 25 NativeAppWindowViews::NativeAppWindowViews() |
| 28 : app_window_(NULL), | 26 : app_window_(NULL), |
| 29 web_view_(NULL), | 27 web_view_(NULL), |
| 30 widget_(NULL), | 28 widget_(NULL), |
| 31 frameless_(false), | 29 frameless_(false), |
| 32 resizable_(false) {} | 30 resizable_(false) {} |
| 33 | 31 |
| 34 void NativeAppWindowViews::Init(AppWindow* app_window, | 32 void NativeAppWindowViews::Init(AppWindow* app_window, |
| 35 const AppWindow::CreateParams& create_params) { | 33 const AppWindow::CreateParams& create_params) { |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 | 319 |
| 322 void NativeAppWindowViews::UpdateWindowIcon() { widget_->UpdateWindowIcon(); } | 320 void NativeAppWindowViews::UpdateWindowIcon() { widget_->UpdateWindowIcon(); } |
| 323 | 321 |
| 324 void NativeAppWindowViews::UpdateWindowTitle() { widget_->UpdateWindowTitle(); } | 322 void NativeAppWindowViews::UpdateWindowTitle() { widget_->UpdateWindowTitle(); } |
| 325 | 323 |
| 326 void NativeAppWindowViews::UpdateBadgeIcon() { | 324 void NativeAppWindowViews::UpdateBadgeIcon() { |
| 327 // Stub implementation. See also ChromeNativeAppWindowViews. | 325 // Stub implementation. See also ChromeNativeAppWindowViews. |
| 328 } | 326 } |
| 329 | 327 |
| 330 void NativeAppWindowViews::UpdateDraggableRegions( | 328 void NativeAppWindowViews::UpdateDraggableRegions( |
| 331 const std::vector<extensions::DraggableRegion>& regions) { | 329 const std::vector<DraggableRegion>& regions) { |
| 332 // Draggable region is not supported for non-frameless window. | 330 // Draggable region is not supported for non-frameless window. |
| 333 if (!frameless_) | 331 if (!frameless_) |
| 334 return; | 332 return; |
| 335 | 333 |
| 336 draggable_region_.reset(AppWindow::RawDraggableRegionsToSkRegion(regions)); | 334 draggable_region_.reset(AppWindow::RawDraggableRegionsToSkRegion(regions)); |
| 337 OnViewWasResized(); | 335 OnViewWasResized(); |
| 338 } | 336 } |
| 339 | 337 |
| 340 SkRegion* NativeAppWindowViews::GetDraggableRegion() { | 338 SkRegion* NativeAppWindowViews::GetDraggableRegion() { |
| 341 return draggable_region_.get(); | 339 return draggable_region_.get(); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 } | 398 } |
| 401 | 399 |
| 402 bool NativeAppWindowViews::CanHaveAlphaEnabled() const { | 400 bool NativeAppWindowViews::CanHaveAlphaEnabled() const { |
| 403 return widget_->IsTranslucentWindowOpacitySupported(); | 401 return widget_->IsTranslucentWindowOpacitySupported(); |
| 404 } | 402 } |
| 405 | 403 |
| 406 void NativeAppWindowViews::SetVisibleOnAllWorkspaces(bool always_visible) { | 404 void NativeAppWindowViews::SetVisibleOnAllWorkspaces(bool always_visible) { |
| 407 widget_->SetVisibleOnAllWorkspaces(always_visible); | 405 widget_->SetVisibleOnAllWorkspaces(always_visible); |
| 408 } | 406 } |
| 409 | 407 |
| 410 } // namespace apps | 408 } // namespace extensions |
| OLD | NEW |