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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/views/frame/non_client_frame_view_switcher_ash.h"
6
7 #include "ash/wm/window_state.h"
8 #include "ui/aura/window.h"
9 #include "ui/views/widget/widget.h"
10 #include "ui/views/window/non_client_view.h"
11
12 NonClientFrameViewSwitcherAsh::NonClientFrameViewSwitcherAsh(
13 views::Widget* frame_widget,
14 aura::Window* frame_window)
15 : frame_widget_(frame_widget),
16 frame_window_(frame_window) {
17 frame_window_->AddObserver(this);
18 ash::wm::GetWindowState(frame_window_)->AddObserver(this);
19 }
20
21 NonClientFrameViewSwitcherAsh::~NonClientFrameViewSwitcherAsh() {
22 if (frame_window_) {
23 frame_window_->RemoveObserver(this);
24 ash::wm::GetWindowState(frame_window_)->RemoveObserver(this);
25 }
26 }
27
28 void NonClientFrameViewSwitcherAsh::OnWindowDestroying(aura::Window* window) {
29 frame_window_->RemoveObserver(this);
30 ash::wm::GetWindowState(frame_window_)->RemoveObserver(this);
31 frame_window_ = NULL;
32 }
33
34 void NonClientFrameViewSwitcherAsh::OnWindowShowTypeChanged(
35 ash::wm::WindowState* window_state,
36 ash::wm::WindowShowType type) {
37 if (frame_widget_->non_client_view() &&
38 (window_state->window_show_type() == ash::wm::SHOW_TYPE_MAXIMIZED ||
39 type == ash::wm::SHOW_TYPE_MAXIMIZED)) {
40 // Defer frame layout when replacing the frame. Layout will occur as a
41 // result of WorkspaceLayoutManager::OnWindowShowTypeChanged().
42 frame_widget_->non_client_view()->UpdateFrame(
43 type == ash::wm::SHOW_TYPE_MINIMIZED);
44 }
45 }
OLDNEW
« 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