| 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 "ash/system/user/user_card_view.h" | 5 #include "ash/system/user/user_card_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // contains a link. | 80 // contains a link. |
| 81 class PublicAccountUserDetails : public views::View, | 81 class PublicAccountUserDetails : public views::View, |
| 82 public views::LinkListener { | 82 public views::LinkListener { |
| 83 public: | 83 public: |
| 84 PublicAccountUserDetails(); | 84 PublicAccountUserDetails(); |
| 85 ~PublicAccountUserDetails() override; | 85 ~PublicAccountUserDetails() override; |
| 86 | 86 |
| 87 private: | 87 private: |
| 88 // Overridden from views::View. | 88 // Overridden from views::View. |
| 89 void Layout() override; | 89 void Layout() override; |
| 90 gfx::Size GetPreferredSize() const override; | 90 gfx::Size CalculatePreferredSize() const override; |
| 91 void OnPaint(gfx::Canvas* canvas) override; | 91 void OnPaint(gfx::Canvas* canvas) override; |
| 92 void GetAccessibleNodeData(ui::AXNodeData* node_data) override; | 92 void GetAccessibleNodeData(ui::AXNodeData* node_data) override; |
| 93 | 93 |
| 94 // Overridden from views::LinkListener. | 94 // Overridden from views::LinkListener. |
| 95 void LinkClicked(views::Link* source, int event_flags) override; | 95 void LinkClicked(views::Link* source, int event_flags) override; |
| 96 | 96 |
| 97 // Calculate a preferred size that ensures the label text and the following | 97 // Calculate a preferred size that ensures the label text and the following |
| 98 // link do not wrap over more than three lines in total for aesthetic reasons | 98 // link do not wrap over more than three lines in total for aesthetic reasons |
| 99 // if possible. | 99 // if possible. |
| 100 void DeterminePreferredSize(); | 100 void DeterminePreferredSize(); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 position.set_y(position.y() - learn_more_->GetInsets().top()); | 201 position.set_y(position.y() - learn_more_->GetInsets().top()); |
| 202 gfx::Rect learn_more_bounds(position, link_size); | 202 gfx::Rect learn_more_bounds(position, link_size); |
| 203 learn_more_bounds.Intersect(contents_area); | 203 learn_more_bounds.Intersect(contents_area); |
| 204 if (base::i18n::IsRTL()) { | 204 if (base::i18n::IsRTL()) { |
| 205 const gfx::Insets insets = GetInsets(); | 205 const gfx::Insets insets = GetInsets(); |
| 206 learn_more_bounds.Offset(insets.right() - insets.left(), 0); | 206 learn_more_bounds.Offset(insets.right() - insets.left(), 0); |
| 207 } | 207 } |
| 208 learn_more_->SetBoundsRect(learn_more_bounds); | 208 learn_more_->SetBoundsRect(learn_more_bounds); |
| 209 } | 209 } |
| 210 | 210 |
| 211 gfx::Size PublicAccountUserDetails::GetPreferredSize() const { | 211 gfx::Size PublicAccountUserDetails::CalculatePreferredSize() const { |
| 212 return preferred_size_; | 212 return preferred_size_; |
| 213 } | 213 } |
| 214 | 214 |
| 215 void PublicAccountUserDetails::OnPaint(gfx::Canvas* canvas) { | 215 void PublicAccountUserDetails::OnPaint(gfx::Canvas* canvas) { |
| 216 for (const auto& line : lines_) | 216 for (const auto& line : lines_) |
| 217 line->Draw(canvas); | 217 line->Draw(canvas); |
| 218 | 218 |
| 219 views::View::OnPaint(canvas); | 219 views::View::OnPaint(canvas); |
| 220 } | 220 } |
| 221 | 221 |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 media_capture_container_ = new views::View(); | 441 media_capture_container_ = new views::View(); |
| 442 media_capture_container_->SetLayoutManager(new views::FillLayout()); | 442 media_capture_container_->SetLayoutManager(new views::FillLayout()); |
| 443 media_capture_container_->AddChildView(media_capture_icon_); | 443 media_capture_container_->AddChildView(media_capture_icon_); |
| 444 AddChildView(media_capture_container_); | 444 AddChildView(media_capture_container_); |
| 445 | 445 |
| 446 Shell::Get()->media_controller()->RequestCaptureState(); | 446 Shell::Get()->media_controller()->RequestCaptureState(); |
| 447 } | 447 } |
| 448 | 448 |
| 449 } // namespace tray | 449 } // namespace tray |
| 450 } // namespace ash | 450 } // namespace ash |
| OLD | NEW |