Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / ash / wm / status_area_layout_manager.h
blob73e81e6be747fe13f11c5fc084f1c8dffa833f34
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.
5 #ifndef ASH_WM_STATUS_AREA_LAYOUT_MANAGER_H_
6 #define ASH_WM_STATUS_AREA_LAYOUT_MANAGER_H_
8 #include "ash/snap_to_pixel_layout_manager.h"
9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h"
11 #include "ui/aura/layout_manager.h"
13 namespace ash {
14 class ShelfWidget;
16 // StatusAreaLayoutManager is a layout manager responsible for the status area.
17 // In any case when status area needs relayout it redirects this call to
18 // ShelfLayoutManager.
19 class StatusAreaLayoutManager : public SnapToPixelLayoutManager {
20 public:
21 StatusAreaLayoutManager(aura::Window* container, ShelfWidget* shelf);
22 virtual ~StatusAreaLayoutManager();
24 // Overridden from aura::LayoutManager:
25 virtual void OnWindowResized() OVERRIDE;
26 virtual void SetChildBounds(aura::Window* child,
27 const gfx::Rect& requested_bounds) OVERRIDE;
29 private:
30 // Updates layout of the status area. Effectively calls ShelfLayoutManager
31 // to update layout of the shelf.
32 void LayoutStatusArea();
34 // True when inside LayoutStatusArea method.
35 // Used to prevent calling itself again from SetChildBounds().
36 bool in_layout_;
38 ShelfWidget* shelf_;
40 DISALLOW_COPY_AND_ASSIGN(StatusAreaLayoutManager);
43 } // namespace ash
45 #endif // ASH_WM_STATUS_AREA_LAYOUT_MANAGER_H_