Home | History | Annotate | Download | only in corewm
      1 // Copyright (c) 2012 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 #ifndef UI_VIEWS_COREWM_WINDOW_UTIL_H_
      6 #define UI_VIEWS_COREWM_WINDOW_UTIL_H_
      7 
      8 #include "base/compiler_specific.h"
      9 #include "ui/views/views_export.h"
     10 
     11 namespace aura {
     12 class Window;
     13 }
     14 
     15 namespace ui {
     16 class Layer;
     17 }
     18 
     19 namespace views {
     20 namespace corewm {
     21 
     22 VIEWS_EXPORT void ActivateWindow(aura::Window* window);
     23 VIEWS_EXPORT void DeactivateWindow(aura::Window* window);
     24 VIEWS_EXPORT bool IsActiveWindow(aura::Window* window);
     25 VIEWS_EXPORT bool CanActivateWindow(aura::Window* window);
     26 
     27 // Retrieves the activatable window for |window|. The ActivationClient makes
     28 // this determination.
     29 VIEWS_EXPORT aura::Window* GetActivatableWindow(aura::Window* window);
     30 
     31 // Retrieves the toplevel window for |window|. The ActivationClient makes this
     32 // determination.
     33 VIEWS_EXPORT aura::Window* GetToplevelWindow(aura::Window* window);
     34 
     35 // Deletes |layer| and all its child layers.
     36 VIEWS_EXPORT void DeepDeleteLayers(ui::Layer* layer);
     37 
     38 // Returns the existing Layer for |window| (and all its descendants) and creates
     39 // a new layer for |window| and all its descendants. This is intended for
     40 // animations that want to animate between the existing visuals and a new window
     41 // state. The caller owns the return value.
     42 //
     43 // As a result of this |window| has freshly created layers, meaning the layers
     44 // are all empty (nothing has been painted to them) and are sized to 0x0. Soon
     45 // after this call you need to reset the bounds of the window. Or, you can pass
     46 // true as the second argument to let the function do that.
     47 VIEWS_EXPORT ui::Layer* RecreateWindowLayers(aura::Window* window,
     48                                             bool set_bounds) WARN_UNUSED_RESULT;
     49 
     50 }  // namespace corewm
     51 }  // namespace views
     52 
     53 #endif  // UI_VIEWS_COREWM_WINDOW_UTIL_H_
     54