dom_browser_view_layout.h revision ddb351dbec246cf1fab5ec20d2d5520909041de1
1// Copyright (c) 2011 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 CHROME_BROWSER_CHROMEOS_FRAME_DOM_BROWSER_VIEW_LAYOUT_H_
6#define CHROME_BROWSER_CHROMEOS_FRAME_DOM_BROWSER_VIEW_LAYOUT_H_
7#pragma once
8
9#include "base/compiler_specific.h"
10#include "chrome/browser/chromeos/frame/dom_browser_view.h"
11#include "chrome/browser/chromeos/status/status_area_host.h"
12#include "chrome/browser/ui/views/frame/browser_view_layout.h"
13
14namespace chromeos {
15
16class DOMBrowserView;
17class StatusAreaView;
18
19// LayoutManager for DOMBrowserView, which lays out the StatusAreaView in the
20// top corner and ommits the other elements that have been removed from the
21// view. There is a bar accross the top of the screen which is clearly divided
22// from the rest of the screen. The far left side will eventually have Add User
23// button in it.
24//
25// |-------------------------------------------------------|
26// |[ Future Add User button]            [Status Area View]| <-- DOMBrowserView
27// |-------------------------------------------------------|
28// |                                                       |
29// |                                                       |
30// |                   DOM screen                          |
31// |                                                       |
32// |                                                       |
33// |                                                       |
34// |-------------------------------------------------------|
35// |                                                       |
36// |                                                       |
37// |                 Touch Keyboard                        |
38// |                                                       |
39// |                                                       |
40// |-------------------------------------------------------|
41
42class DOMBrowserViewLayout : public ::BrowserViewLayout {
43 public:
44  DOMBrowserViewLayout();
45  virtual ~DOMBrowserViewLayout();
46
47  // BrowserViewLayout overrides:
48  virtual void Installed(views::View* host) OVERRIDE;
49  virtual void ViewAdded(views::View* host,
50                         views::View* view) OVERRIDE;
51  virtual bool IsPositionInWindowCaption(const gfx::Point& point) OVERRIDE;
52  virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE;
53
54 protected:
55  // BrowserViewLayout overrides:
56  virtual int LayoutTabStrip() OVERRIDE;
57  virtual int LayoutToolbar(int top) OVERRIDE;
58  virtual int LayoutBookmarkAndInfoBars(int top) OVERRIDE;
59
60 private:
61  const DOMBrowserView* GetDOMBrowserView();
62  StatusAreaView* status_area_;
63
64  // Tests if the point is on one of views that are within the
65  // considered title bar area of client view.
66  bool IsPointInViewsInTitleArea(const gfx::Point& point) const;
67
68  // Lays out tabstrip and status area in the title bar area (given by
69  // |bounds|).
70  int LayoutTitlebarComponents(const gfx::Rect& bounds);
71
72  DISALLOW_COPY_AND_ASSIGN(DOMBrowserViewLayout);
73};
74
75}  // namespace chromeos
76
77#endif  // CHROME_BROWSER_CHROMEOS_FRAME_DOM_BROWSER_VIEW_LAYOUT_H_
78