window_state_observer.h revision a1401311d1ab56c4ed0a474bd38c108f75cb0cd9
14e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved. 24e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 34e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)// found in the LICENSE file. 44e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 54e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#ifndef ASH_WM_WINDOW_STATE_OBSERVER_H_ 64e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#define ASH_WM_WINDOW_STATE_OBSERVER_H_ 74e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 88bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)#include "ash/ash_export.h" 94e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#include "ash/wm/wm_types.h" 104e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 114e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)namespace ash { 124e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)namespace wm { 134e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)class WindowState; 144e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 154e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)class ASH_EXPORT WindowStateObserver { 164e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) public: 175d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Following observer methods are different from kWindowShowStatekey 185d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // property change as they will be invoked when the window 194e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) // gets left/right maximized, and auto positioned. |old_type| is the value 204e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) // before the change. 215d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 22a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // Called after the window's state type is set to new type, but before 235d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // the window's bounds has been updated for the new type. 245d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // This is used to update the shell state such as work area so 255d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // that the window can use the correct environment to update its bounds. 265d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // TODO(oshima): Remove this once docked windows has its own state. 27a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) virtual void OnPreWindowStateTypeChange(WindowState* window_state, 28a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) WindowStateType old_type) {} 295d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 30a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // Called after the window's state has been updated. 31a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // This is used to update the shell state that depends on the updated 325d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // window bounds, such as shelf visibility. 33a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) virtual void OnPostWindowStateTypeChange(WindowState* window_state, 34a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) WindowStateType old_type) {} 354e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)}; 364e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 374e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)} // namespace wm 384e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)} // namespace ash 394e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 404e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#endif // ASH_WM_WINDOW_STATE_OBSERVER_H_ 41