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

Unified Diff: ui/views/widget/desktop_layout_manager.cc

Issue 10941040: linux_aura: Make combo boxes work with DesktopRootWindowHostLinux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move the DesktopLayoutManager to ui/views/ Created 8 years, 3 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 | « ui/views/widget/desktop_layout_manager.h ('k') | ui/views/widget/desktop_root_window_host_linux.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_layout_manager.cc
diff --git a/ui/views/widget/desktop_layout_manager.cc b/ui/views/widget/desktop_layout_manager.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c012dbf1a4cbf09a0031c2c372e0d794c69ee4de
--- /dev/null
+++ b/ui/views/widget/desktop_layout_manager.cc
@@ -0,0 +1,56 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/views/widget/desktop_layout_manager.h"
+
+#include "ui/aura/root_window.h"
+#include "ui/gfx/rect.h"
+
+namespace views {
+
+DesktopLayoutManager::DesktopLayoutManager(aura::RootWindow* root_window)
+ : root_window_(root_window),
+ main_window_(NULL) {
+}
+
+DesktopLayoutManager::~DesktopLayoutManager() {}
+
+void DesktopLayoutManager::OnWindowResized() {
+ if (main_window_)
+ SetMainWindowSize();
+}
+
+void DesktopLayoutManager::OnWindowAddedToLayout(aura::Window* child) {
+ if (!main_window_) {
+ main_window_ = child;
+
+ SetMainWindowSize();
+ }
+}
+
+void DesktopLayoutManager::OnWillRemoveWindowFromLayout(aura::Window* child) {
+ if (main_window_ == child)
+ main_window_ = NULL;
+}
+
+void DesktopLayoutManager::OnWindowRemovedFromLayout(aura::Window* child) {
+}
+
+void DesktopLayoutManager::OnChildWindowVisibilityChanged(aura::Window* child,
+ bool visible) {
+}
+
+void DesktopLayoutManager::SetChildBounds(aura::Window* child,
+ const gfx::Rect& requested_bounds) {
+ if (main_window_ != child)
+ SetChildBoundsDirect(child, requested_bounds);
+}
+
+void DesktopLayoutManager::SetMainWindowSize() {
+ gfx::Rect bounds;
+ bounds.set_size(root_window_->GetHostSize());
+ SetChildBoundsDirect(main_window_, bounds);
+}
+
+} // namespace views
« no previous file with comments | « ui/views/widget/desktop_layout_manager.h ('k') | ui/views/widget/desktop_root_window_host_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698