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
|
// Copyright 2013 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.
#include "chrome/browser/ui/views/message_center/message_center_frame_view.h"
#include "ui/base/hit_test.h"
#include "ui/message_center/message_center_style.h"
#include "ui/views/shadow_border.h"
#include "ui/views/widget/widget.h"
namespace message_center {
MessageCenterFrameView::MessageCenterFrameView() {
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
const int kBorderWidth = 1;
SetBorder(views::Border::CreateSolidBorder(
kBorderWidth, message_center::kMessageCenterBorderColor));
#else
const int kShadowBlur = 8;
SetBorder(scoped_ptr<views::Border>(new views::ShadowBorder(
kShadowBlur,
message_center::kMessageCenterShadowColor,
0, // Vertical offset
0))); // Horizontal offset
#endif
}
MessageCenterFrameView::~MessageCenterFrameView() {}
gfx::Rect MessageCenterFrameView::GetBoundsForClientView() const {
gfx::Rect client_bounds = GetLocalBounds();
client_bounds.Inset(GetInsets());
return client_bounds;
}
gfx::Rect MessageCenterFrameView::GetWindowBoundsForClientBounds(
const gfx::Rect& client_bounds) const {
gfx::Rect window_bounds = client_bounds;
window_bounds.Inset(GetInsets());
return window_bounds;
}
int MessageCenterFrameView::NonClientHitTest(const gfx::Point& point) {
gfx::Rect frame_bounds = bounds();
frame_bounds.Inset(GetInsets());
if (!frame_bounds.Contains(point))
return HTNOWHERE;
return GetWidget()->client_view()->NonClientHitTest(point);
}
void MessageCenterFrameView::GetWindowMask(const gfx::Size& size,
gfx::Path* window_mask) {
}
void MessageCenterFrameView::ResetWindowControls() {
}
void MessageCenterFrameView::UpdateWindowIcon() {
}
void MessageCenterFrameView::UpdateWindowTitle() {
}
void MessageCenterFrameView::SizeConstraintsChanged() {
}
gfx::Insets MessageCenterFrameView::GetInsets() const {
return border()->GetInsets();
}
const char* MessageCenterFrameView::GetClassName() const {
return "MessageCenterFrameView";
}
} // namespace message_center
|