blob: e1a982eea281745d34dd6f26bd425842212d1573 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_NON_CLIENT_VIEW_H_
#define CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_NON_CLIENT_VIEW_H_
#include "chrome/browser/views/frame/aero_glass_frame.h"
#include "chrome/views/non_client_view.h"
#include "chrome/views/button.h"
class BrowserView;
class AeroGlassWindowResources;
class AeroGlassNonClientView : public views::NonClientView {
public:
// Constructs a non-client view for an AeroGlassFrame.
AeroGlassNonClientView(AeroGlassFrame* frame, BrowserView* browser_view);
virtual ~AeroGlassNonClientView();
gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip);
protected:
// Overridden from views::NonClientView:
virtual gfx::Rect CalculateClientAreaBounds(int width, int height) const;
virtual gfx::Size CalculateWindowSizeForClientSize(int width,
int height) const;
virtual CPoint GetSystemMenuPoint() const;
virtual int NonClientHitTest(const gfx::Point& point);
virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask);
virtual void EnableClose(bool enable);
virtual void ResetWindowControls();
// Overridden from views::View:
virtual void Paint(ChromeCanvas* canvas);
virtual void Layout();
virtual gfx::Size GetPreferredSize();
virtual void ViewHierarchyChanged(bool is_add,
views::View* parent,
views::View* child);
private:
// Returns the height of the non-client area at the top of the window (the
// title bar, etc).
int CalculateNonClientTopHeight() const;
// Paint various sub-components of this view.
void PaintOTRAvatar(ChromeCanvas* canvas);
void PaintDistributorLogo(ChromeCanvas* canvas);
void PaintToolbarBackground(ChromeCanvas* canvas);
void PaintClientEdge(ChromeCanvas* canvas);
// Layout various sub-components of this view.
void LayoutOTRAvatar();
void LayoutDistributorLogo();
void LayoutClientView();
// The layout rect of the distributor logo, if visible.
gfx::Rect logo_bounds_;
// The layout rect of the OTR avatar.
gfx::Rect otr_avatar_bounds_;
// The frame that hosts this view.
AeroGlassFrame* frame_;
// The BrowserView that we contain.
BrowserView* browser_view_;
static void InitClass();
static SkBitmap distributor_logo_;
static AeroGlassWindowResources* resources_;
DISALLOW_EVIL_CONSTRUCTORS(AeroGlassNonClientView);
};
#endif // #ifndef CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_NON_CLIENT_VIEW_H_
|