Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Unified Diff: ash/wm/aura/wm_window_aura.cc

Issue 1907863002: Converts DockedWindowLayoutManager to common ash/wm types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/aura/wm_window_aura.h ('k') | ash/wm/common/wm_activation_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/aura/wm_window_aura.cc
diff --git a/ash/wm/aura/wm_window_aura.cc b/ash/wm/aura/wm_window_aura.cc
index 2dde352e5e023b3165d81a8aa2ffe85e218fe335..9bbde25f21be0d6220b47363edba6e25bb10bf01 100644
--- a/ash/wm/aura/wm_window_aura.cc
+++ b/ash/wm/aura/wm_window_aura.cc
@@ -5,8 +5,10 @@
#include "ash/wm/aura/wm_window_aura.h"
#include "ash/screen_util.h"
+#include "ash/wm/aura/aura_layout_manager_adapter.h"
#include "ash/wm/aura/wm_globals_aura.h"
#include "ash/wm/aura/wm_root_window_controller_aura.h"
+#include "ash/wm/common/wm_layout_manager.h"
#include "ash/wm/common/wm_window_observer.h"
#include "ash/wm/common/wm_window_property.h"
#include "ash/wm/window_animations.h"
@@ -70,6 +72,11 @@ WmWindowAura::WmWindowAura(aura::Window* window) : window_(window) {
}
// static
+WmWindow* WmWindow::Get(views::Widget* widget) {
+ return WmWindowAura::Get(widget->GetNativeWindow());
+}
+
+// static
WmWindow* WmWindowAura::Get(aura::Window* window) {
if (!window)
return nullptr;
@@ -152,12 +159,12 @@ gfx::Rect WmWindowAura::ConvertRectFromScreen(const gfx::Rect& rect) const {
return ScreenUtil::ConvertRectFromScreen(window_, rect);
}
-gfx::Size WmWindowAura::GetMinimumSize() {
+gfx::Size WmWindowAura::GetMinimumSize() const {
return window_->delegate() ? window_->delegate()->GetMinimumSize()
: gfx::Size();
}
-gfx::Size WmWindowAura::GetMaximumSize() {
+gfx::Size WmWindowAura::GetMaximumSize() const {
return window_->delegate() ? window_->delegate()->GetMaximumSize()
: gfx::Size();
}
@@ -205,7 +212,7 @@ WmWindow* WmWindowAura::GetParent() {
return Get(window_->parent());
}
-WmWindow* WmWindowAura::GetTransientParent() {
+const WmWindow* WmWindowAura::GetTransientParent() const {
return Get(::wm::GetTransientParent(window_));
}
@@ -218,10 +225,26 @@ std::vector<WmWindow*> WmWindowAura::GetTransientChildren() {
return wm_windows;
}
+void WmWindowAura::SetLayoutManager(
+ std::unique_ptr<WmLayoutManager> layout_manager) {
+ // |window_| takes ownership of AuraLayoutManagerAdapter.
+ window_->SetLayoutManager(
+ new AuraLayoutManagerAdapter(std::move(layout_manager)));
+}
+
+WmLayoutManager* WmWindowAura::GetLayoutManager() {
+ return static_cast<AuraLayoutManagerAdapter*>(window_->layout_manager())
+ ->wm_layout_manager();
+}
+
void WmWindowAura::SetVisibilityAnimationType(int type) {
::wm::SetWindowVisibilityAnimationType(window_, type);
}
+void WmWindowAura::SetVisibilityAnimationDuration(base::TimeDelta delta) {
+ ::wm::SetWindowVisibilityAnimationDuration(window_, delta);
+}
+
void WmWindowAura::Animate(::wm::WindowAnimationType type) {
::wm::AnimateWindow(window_, type);
}
@@ -374,6 +397,10 @@ void WmWindowAura::StackChildAtTop(WmWindow* child) {
window_->StackChildAtTop(GetAuraWindow(child));
}
+void WmWindowAura::StackChildAtBottom(WmWindow* child) {
+ window_->StackChildAtBottom(GetAuraWindow(child));
+}
+
void WmWindowAura::StackChildAbove(WmWindow* child, WmWindow* target) {
window_->StackChildAbove(GetAuraWindow(child), GetAuraWindow(target));
}
@@ -398,6 +425,10 @@ void WmWindowAura::Show() {
window_->Show();
}
+bool WmWindowAura::IsFocused() const {
+ return window_->HasFocus();
+}
+
bool WmWindowAura::IsActive() const {
return IsActiveWindow(window_);
}
@@ -438,6 +469,10 @@ WmWindow* WmWindowAura::GetChildByShellWindowId(int id) {
return Get(window_->GetChildById(id));
}
+void WmWindowAura::SnapToPixelBoundaryIfNecessary() {
+ SnapWindowToPixelBoundary(window_);
+}
+
void WmWindowAura::AddObserver(WmWindowObserver* observer) {
observers_.AddObserver(observer);
}
@@ -495,5 +530,11 @@ void WmWindowAura::OnWindowDestroying(aura::Window* window) {
FOR_EACH_OBSERVER(WmWindowObserver, observers_, OnWindowDestroying(this));
}
+void WmWindowAura::OnWindowVisibilityChanging(aura::Window* window,
+ bool visible) {
+ FOR_EACH_OBSERVER(WmWindowObserver, observers_,
+ OnWindowVisibilityChanging(this, visible));
+}
+
} // namespace wm
} // namespace ash
« no previous file with comments | « ash/wm/aura/wm_window_aura.h ('k') | ash/wm/common/wm_activation_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698