| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "athena/activity/activity_frame_view.h" | 5 #include "athena/activity/activity_frame_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "athena/activity/public/activity_view_model.h" | 10 #include "athena/activity/public/activity_view_model.h" |
| 11 #include "ui/base/hit_test.h" | 11 #include "ui/base/hit_test.h" |
| 12 #include "ui/views/background.h" | 12 #include "ui/views/background.h" |
| 13 #include "ui/views/border.h" |
| 13 #include "ui/views/controls/label.h" | 14 #include "ui/views/controls/label.h" |
| 14 #include "ui/views/view.h" | 15 #include "ui/views/view.h" |
| 15 #include "ui/views/widget/widget.h" | 16 #include "ui/views/widget/widget.h" |
| 16 #include "ui/views/widget/widget_delegate.h" | 17 #include "ui/views/widget/widget_delegate.h" |
| 17 | 18 |
| 18 namespace athena { | 19 namespace athena { |
| 19 | 20 |
| 20 //////////////////////////////////////////////////////////////////////////////// | 21 //////////////////////////////////////////////////////////////////////////////// |
| 21 // FrameViewAthena, public: | 22 // FrameViewAthena, public: |
| 22 | 23 |
| 23 // static | 24 // static |
| 24 const char ActivityFrameView::kViewClassName[] = "ActivityFrameView"; | 25 const char ActivityFrameView::kViewClassName[] = "ActivityFrameView"; |
| 25 | 26 |
| 26 ActivityFrameView::ActivityFrameView(views::Widget* frame, | 27 ActivityFrameView::ActivityFrameView(views::Widget* frame, |
| 27 ActivityViewModel* view_model) | 28 ActivityViewModel* view_model) |
| 28 : frame_(frame), view_model_(view_model), title_(new views::Label) { | 29 : frame_(frame), view_model_(view_model), title_(new views::Label) { |
| 29 title_->SetHorizontalAlignment(gfx::ALIGN_CENTER); | 30 title_->SetHorizontalAlignment(gfx::ALIGN_CENTER); |
| 30 const gfx::FontList& font_list = title_->font_list(); | 31 title_->SetEnabledColor(SkColorSetA(SK_ColorBLACK, 0xe5)); |
| 31 title_->SetFontList(font_list.Derive(1, gfx::Font::BOLD)); | 32 title_->SetBorder(views::Border::CreateSolidSidedBorder(0, 0, 1, 0, |
| 32 title_->SetEnabledColor(SK_ColorBLACK); | 33 SkColorSetA(SK_ColorGRAY, 0x7f))); |
| 33 AddChildView(title_); | 34 AddChildView(title_); |
| 34 UpdateWindowTitle(); | 35 UpdateWindowTitle(); |
| 35 } | 36 } |
| 36 | 37 |
| 37 ActivityFrameView::~ActivityFrameView() { | 38 ActivityFrameView::~ActivityFrameView() { |
| 38 } | 39 } |
| 39 | 40 |
| 40 //////////////////////////////////////////////////////////////////////////////// | 41 //////////////////////////////////////////////////////////////////////////////// |
| 41 // ActivityFrameView, views::NonClientFrameView overrides: | 42 // ActivityFrameView, views::NonClientFrameView overrides: |
| 42 | 43 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 100 |
| 100 //////////////////////////////////////////////////////////////////////////////// | 101 //////////////////////////////////////////////////////////////////////////////// |
| 101 // ActivityFrameView, private: | 102 // ActivityFrameView, private: |
| 102 | 103 |
| 103 int ActivityFrameView::NonClientTopBorderHeight() const { | 104 int ActivityFrameView::NonClientTopBorderHeight() const { |
| 104 const int kDefaultTitleHeight = 25; | 105 const int kDefaultTitleHeight = 25; |
| 105 return frame_->IsFullscreen() ? 0 : kDefaultTitleHeight; | 106 return frame_->IsFullscreen() ? 0 : kDefaultTitleHeight; |
| 106 } | 107 } |
| 107 | 108 |
| 108 } // namespace ash | 109 } // namespace ash |
| OLD | NEW |