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

Unified Diff: chrome/browser/ui/views/frame/non_client_frame_view_switcher_ash.cc

Issue 25536010: Make packaged apps use AppNonClientFrameViewAsh when maximized (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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 | « chrome/browser/ui/views/frame/non_client_frame_view_switcher_ash.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/non_client_frame_view_switcher_ash.cc
diff --git a/chrome/browser/ui/views/frame/non_client_frame_view_switcher_ash.cc b/chrome/browser/ui/views/frame/non_client_frame_view_switcher_ash.cc
new file mode 100644
index 0000000000000000000000000000000000000000..715f92effe98935dece3f0ca258428473ea07702
--- /dev/null
+++ b/chrome/browser/ui/views/frame/non_client_frame_view_switcher_ash.cc
@@ -0,0 +1,45 @@
+// Copyright 2013 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 "chrome/browser/ui/views/frame/non_client_frame_view_switcher_ash.h"
+
+#include "ash/wm/window_state.h"
+#include "ui/aura/window.h"
+#include "ui/views/widget/widget.h"
+#include "ui/views/window/non_client_view.h"
+
+NonClientFrameViewSwitcherAsh::NonClientFrameViewSwitcherAsh(
+ views::Widget* frame_widget,
+ aura::Window* frame_window)
+ : frame_widget_(frame_widget),
+ frame_window_(frame_window) {
+ frame_window_->AddObserver(this);
+ ash::wm::GetWindowState(frame_window_)->AddObserver(this);
+}
+
+NonClientFrameViewSwitcherAsh::~NonClientFrameViewSwitcherAsh() {
+ if (frame_window_) {
+ frame_window_->RemoveObserver(this);
+ ash::wm::GetWindowState(frame_window_)->RemoveObserver(this);
+ }
+}
+
+void NonClientFrameViewSwitcherAsh::OnWindowDestroying(aura::Window* window) {
+ frame_window_->RemoveObserver(this);
+ ash::wm::GetWindowState(frame_window_)->RemoveObserver(this);
+ frame_window_ = NULL;
+}
+
+void NonClientFrameViewSwitcherAsh::OnWindowShowTypeChanged(
+ ash::wm::WindowState* window_state,
+ ash::wm::WindowShowType type) {
+ if (frame_widget_->non_client_view() &&
+ (window_state->window_show_type() == ash::wm::SHOW_TYPE_MAXIMIZED ||
+ type == ash::wm::SHOW_TYPE_MAXIMIZED)) {
+ // Defer frame layout when replacing the frame. Layout will occur as a
+ // result of WorkspaceLayoutManager::OnWindowShowTypeChanged().
+ frame_widget_->non_client_view()->UpdateFrame(
+ type == ash::wm::SHOW_TYPE_MINIMIZED);
+ }
+}
« no previous file with comments | « chrome/browser/ui/views/frame/non_client_frame_view_switcher_ash.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698