Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 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/views/widget/widget.h" | |
| 9 | |
| 10 namespace { | |
| 11 | |
| 12 const SkColor kBorderColor = SkColorSetARGB(0xFF, 0xC7, 0xCA, 0xCE); | |
|
dewittj
2013/06/28 01:13:18
Where did this color come from?
sidharthms
2013/07/02 18:09:51
Done. Moved to MessageCenterStyle
| |
| 13 | |
| 14 } // namespace | |
| 15 | |
| 16 namespace message_center { | |
| 17 | |
| 18 MessageCenterFrameView::MessageCenterFrameView(int border_width) | |
| 19 : border_width_(border_width) { | |
| 20 set_border(views::Border::CreateSolidBorder(border_width, kBorderColor)); | |
| 21 } | |
| 22 | |
| 23 MessageCenterFrameView::~MessageCenterFrameView() {} | |
| 24 | |
| 25 gfx::Rect MessageCenterFrameView::GetBoundsForClientView() const { | |
| 26 gfx::Rect client_bounds = GetLocalBounds(); | |
| 27 client_bounds.Inset(GetInsets()); | |
| 28 return client_bounds; | |
| 29 } | |
| 30 | |
| 31 gfx::Rect MessageCenterFrameView::GetWindowBoundsForClientBounds( | |
| 32 const gfx::Rect& client_bounds) const { | |
| 33 return gfx::Rect(client_bounds.size()); | |
|
dewittj
2013/06/28 01:13:18
This might be why you don't see the border on Wind
sidharthms
2013/07/02 18:09:51
Done.
| |
| 34 } | |
| 35 | |
| 36 int MessageCenterFrameView::NonClientHitTest(const gfx::Point& point) { | |
| 37 if (!bounds().Contains(point)) | |
| 38 return HTNOWHERE; | |
| 39 | |
| 40 return GetWidget()->client_view()->NonClientHitTest(point); | |
| 41 } | |
| 42 | |
| 43 gfx::Insets MessageCenterFrameView::GetInsets() const { | |
| 44 return gfx::Insets( | |
| 45 border_width_, border_width_, border_width_, border_width_); | |
| 46 } | |
| 47 | |
| 48 const char* MessageCenterFrameView::GetClassName() const { | |
| 49 return "MessageCenterFrameView"; | |
| 50 } | |
| 51 | |
| 52 } // namespace message_center | |
| OLD | NEW |