1 // Copyright 2013 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 #include "chrome/browser/ui/views/message_center/message_center_frame_view.h"
7 #include "ui/base/hit_test.h"
8 #include "ui/gfx/geometry/vector2d.h"
9 #include "ui/gfx/shadow_value.h"
10 #include "ui/message_center/message_center_style.h"
11 #include "ui/views/shadow_border.h"
12 #include "ui/views/widget/widget.h"
14 namespace message_center
{
16 MessageCenterFrameView::MessageCenterFrameView() {
17 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
18 const int kBorderWidth
= 1;
19 SetBorder(views::Border::CreateSolidBorder(
20 kBorderWidth
, message_center::kMessageCenterBorderColor
));
22 const int kShadowBlur
= 8;
23 SetBorder(scoped_ptr
<views::Border
>(new views::ShadowBorder(
24 gfx::ShadowValue(gfx::Vector2d(0, 0), kShadowBlur
,
25 message_center::kMessageCenterShadowColor
))));
29 MessageCenterFrameView::~MessageCenterFrameView() {}
31 gfx::Rect
MessageCenterFrameView::GetBoundsForClientView() const {
32 gfx::Rect client_bounds
= GetLocalBounds();
33 client_bounds
.Inset(GetInsets());
37 gfx::Rect
MessageCenterFrameView::GetWindowBoundsForClientBounds(
38 const gfx::Rect
& client_bounds
) const {
39 gfx::Rect window_bounds
= client_bounds
;
40 window_bounds
.Inset(GetInsets());
44 int MessageCenterFrameView::NonClientHitTest(const gfx::Point
& point
) {
45 gfx::Rect frame_bounds
= bounds();
46 frame_bounds
.Inset(GetInsets());
47 if (!frame_bounds
.Contains(point
))
50 return GetWidget()->client_view()->NonClientHitTest(point
);
53 void MessageCenterFrameView::GetWindowMask(const gfx::Size
& size
,
54 gfx::Path
* window_mask
) {
57 void MessageCenterFrameView::ResetWindowControls() {
60 void MessageCenterFrameView::UpdateWindowIcon() {
63 void MessageCenterFrameView::UpdateWindowTitle() {
66 void MessageCenterFrameView::SizeConstraintsChanged() {
69 gfx::Insets
MessageCenterFrameView::GetInsets() const {
70 return border()->GetInsets();
73 const char* MessageCenterFrameView::GetClassName() const {
74 return "MessageCenterFrameView";
77 } // namespace message_center