Add a minor text member to ui::MenuModel.
[chromium-blink-merge.git] / chrome / browser / ui / views / message_center / message_center_frame_view.cc
blob0efd86346296b23195d3c38ae2083adc30a29908
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/message_center/message_center_style.h"
9 #include "ui/views/shadow_border.h"
10 #include "ui/views/widget/widget.h"
12 namespace {
14 const int kBorderWidth = 1;
15 const int kShadowBlur = 8;
17 } // namepspace
19 namespace message_center {
21 MessageCenterFrameView::MessageCenterFrameView() {
22 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
23 set_border(views::Border::CreateSolidBorder(
24 kBorderWidth, message_center::kMessageCenterBorderColor));
25 #else
26 set_border(new views::ShadowBorder(kShadowBlur,
27 message_center::kMessageCenterShadowColor,
28 0, // Vertical offset
29 0)); // Horizontal offset
30 #endif
33 MessageCenterFrameView::~MessageCenterFrameView() {}
35 gfx::Rect MessageCenterFrameView::GetBoundsForClientView() const {
36 gfx::Rect client_bounds = GetLocalBounds();
37 client_bounds.Inset(GetInsets());
38 return client_bounds;
41 gfx::Rect MessageCenterFrameView::GetWindowBoundsForClientBounds(
42 const gfx::Rect& client_bounds) const {
43 gfx::Rect window_bounds = client_bounds;
44 window_bounds.Inset(GetInsets());
45 return window_bounds;
48 int MessageCenterFrameView::NonClientHitTest(const gfx::Point& point) {
49 gfx::Rect frame_bounds = bounds();
50 frame_bounds.Inset(GetInsets());
51 if (!frame_bounds.Contains(point))
52 return HTNOWHERE;
54 return GetWidget()->client_view()->NonClientHitTest(point);
57 void MessageCenterFrameView::GetWindowMask(const gfx::Size& size,
58 gfx::Path* window_mask) {
61 void MessageCenterFrameView::ResetWindowControls() {
64 void MessageCenterFrameView::UpdateWindowIcon() {
67 void MessageCenterFrameView::UpdateWindowTitle() {
70 gfx::Insets MessageCenterFrameView::GetInsets() const {
71 return border()->GetInsets();
74 const char* MessageCenterFrameView::GetClassName() const {
75 return "MessageCenterFrameView";
78 } // namespace message_center