message_center_frame_view.cc revision 8bcbed890bc3ce4d7a057a8f32cab53fa534672e
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.
4
5#include "chrome/browser/ui/views/message_center/message_center_frame_view.h"
6
7#include "ui/base/hit_test.h"
8#include "ui/message_center/message_center_style.h"
9#include "ui/views/shadow_border.h"
10#include "ui/views/widget/widget.h"
11
12namespace message_center {
13
14MessageCenterFrameView::MessageCenterFrameView() {
15#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
16  const int kBorderWidth = 1;
17  set_border(views::Border::CreateSolidBorder(
18      kBorderWidth, message_center::kMessageCenterBorderColor));
19#else
20  const int kShadowBlur = 8;
21  set_border(new views::ShadowBorder(kShadowBlur,
22                                     message_center::kMessageCenterShadowColor,
23                                     0,    // Vertical offset
24                                     0));  // Horizontal offset
25#endif
26}
27
28MessageCenterFrameView::~MessageCenterFrameView() {}
29
30gfx::Rect MessageCenterFrameView::GetBoundsForClientView() const {
31  gfx::Rect client_bounds = GetLocalBounds();
32  client_bounds.Inset(GetInsets());
33  return client_bounds;
34}
35
36gfx::Rect MessageCenterFrameView::GetWindowBoundsForClientBounds(
37    const gfx::Rect& client_bounds) const {
38  gfx::Rect window_bounds = client_bounds;
39  window_bounds.Inset(GetInsets());
40  return window_bounds;
41}
42
43int MessageCenterFrameView::NonClientHitTest(const gfx::Point& point) {
44  gfx::Rect frame_bounds = bounds();
45  frame_bounds.Inset(GetInsets());
46  if (!frame_bounds.Contains(point))
47    return HTNOWHERE;
48
49  return GetWidget()->client_view()->NonClientHitTest(point);
50}
51
52void MessageCenterFrameView::GetWindowMask(const gfx::Size& size,
53                                           gfx::Path* window_mask) {
54}
55
56void MessageCenterFrameView::ResetWindowControls() {
57}
58
59void MessageCenterFrameView::UpdateWindowIcon() {
60}
61
62void MessageCenterFrameView::UpdateWindowTitle() {
63}
64
65gfx::Insets MessageCenterFrameView::GetInsets() const {
66  return border()->GetInsets();
67}
68
69const char* MessageCenterFrameView::GetClassName() const {
70  return "MessageCenterFrameView";
71}
72
73}  // namespace message_center
74