OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 // A view to display a single IssueAdviceInfoEntry. | 126 // A view to display a single IssueAdviceInfoEntry. |
127 class IssueAdviceView : public views::View, | 127 class IssueAdviceView : public views::View, |
128 public ui::AnimationDelegate { | 128 public ui::AnimationDelegate { |
129 public: | 129 public: |
130 IssueAdviceView(ExtensionInstallDialogView* owner, | 130 IssueAdviceView(ExtensionInstallDialogView* owner, |
131 const IssueAdviceInfoEntry& issue_advice, | 131 const IssueAdviceInfoEntry& issue_advice, |
132 int horizontal_space); | 132 int horizontal_space); |
133 virtual ~IssueAdviceView() {} | 133 virtual ~IssueAdviceView() {} |
134 | 134 |
135 // Implementation of views::View: | 135 // Implementation of views::View: |
136 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; | 136 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; |
137 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE; | 137 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; |
138 virtual void ChildPreferredSizeChanged(views::View* child) OVERRIDE; | 138 virtual void ChildPreferredSizeChanged(views::View* child) OVERRIDE; |
139 | 139 |
140 // Implementation of ui::AnimationDelegate: | 140 // Implementation of ui::AnimationDelegate: |
141 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; | 141 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
142 | 142 |
143 private: | 143 private: |
144 // A view which displays all the details of an IssueAdviceInfoEntry. | 144 // A view which displays all the details of an IssueAdviceInfoEntry. |
145 class DetailsView : public views::View { | 145 class DetailsView : public views::View { |
146 public: | 146 public: |
147 explicit DetailsView(int horizontal_space); | 147 explicit DetailsView(int horizontal_space); |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 return; | 579 return; |
580 | 580 |
581 layout->StartRow(0, column_set_id); | 581 layout->StartRow(0, column_set_id); |
582 layout->SkipColumns(1); | 582 layout->SkipColumns(1); |
583 layout->AddView(details_view_); | 583 layout->AddView(details_view_); |
584 | 584 |
585 for (size_t i = 0; i < issue_advice.details.size(); ++i) | 585 for (size_t i = 0; i < issue_advice.details.size(); ++i) |
586 details_view_->AddDetail(issue_advice.details[i]); | 586 details_view_->AddDetail(issue_advice.details[i]); |
587 } | 587 } |
588 | 588 |
589 bool IssueAdviceView::OnMousePressed(const views::MouseEvent& event) { | 589 bool IssueAdviceView::OnMousePressed(const ui::MouseEvent& event) { |
590 return details_view_ && event.IsLeftMouseButton(); | 590 return details_view_ && event.IsLeftMouseButton(); |
591 } | 591 } |
592 | 592 |
593 void IssueAdviceView::OnMouseReleased(const views::MouseEvent& event) { | 593 void IssueAdviceView::OnMouseReleased(const ui::MouseEvent& event) { |
594 if (slide_animation_.IsShowing()) | 594 if (slide_animation_.IsShowing()) |
595 slide_animation_.Hide(); | 595 slide_animation_.Hide(); |
596 else | 596 else |
597 slide_animation_.Show(); | 597 slide_animation_.Show(); |
598 } | 598 } |
599 | 599 |
600 void IssueAdviceView::AnimationProgressed(const ui::Animation* animation) { | 600 void IssueAdviceView::AnimationProgressed(const ui::Animation* animation) { |
601 DCHECK_EQ(animation, &slide_animation_); | 601 DCHECK_EQ(animation, &slide_animation_); |
602 | 602 |
603 if (details_view_) | 603 if (details_view_) |
(...skipping 10 matching lines...) Expand all Loading... |
614 rotate.ConcatTranslate(arrow_view_->width() / 2.0, | 614 rotate.ConcatTranslate(arrow_view_->width() / 2.0, |
615 arrow_view_->height() / 2.0); | 615 arrow_view_->height() / 2.0); |
616 } | 616 } |
617 arrow_view_->SetTransform(rotate); | 617 arrow_view_->SetTransform(rotate); |
618 } | 618 } |
619 } | 619 } |
620 | 620 |
621 void IssueAdviceView::ChildPreferredSizeChanged(views::View* child) { | 621 void IssueAdviceView::ChildPreferredSizeChanged(views::View* child) { |
622 owner_->SizeToContents(); | 622 owner_->SizeToContents(); |
623 } | 623 } |
OLD | NEW |