| 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 "ui/app_list/views/app_list_view.h" | 5 #include "ui/app_list/views/app_list_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 // The background for the App List overlay, which appears as a white rounded | 84 // The background for the App List overlay, which appears as a white rounded |
| 85 // rectangle with the given radius and the same size as the target view. | 85 // rectangle with the given radius and the same size as the target view. |
| 86 class AppListOverlayBackground : public views::Background { | 86 class AppListOverlayBackground : public views::Background { |
| 87 public: | 87 public: |
| 88 AppListOverlayBackground(int corner_radius) | 88 AppListOverlayBackground(int corner_radius) |
| 89 : corner_radius_(corner_radius) {}; | 89 : corner_radius_(corner_radius) {}; |
| 90 virtual ~AppListOverlayBackground() {}; | 90 virtual ~AppListOverlayBackground() {}; |
| 91 | 91 |
| 92 // Overridden from views::Background: | 92 // Overridden from views::Background: |
| 93 virtual void Paint(gfx::Canvas* canvas, views::View* view) const OVERRIDE { | 93 virtual void Paint(gfx::Canvas* canvas, views::View* view) const override { |
| 94 SkPaint paint; | 94 SkPaint paint; |
| 95 paint.setStyle(SkPaint::kFill_Style); | 95 paint.setStyle(SkPaint::kFill_Style); |
| 96 paint.setColor(SK_ColorWHITE); | 96 paint.setColor(SK_ColorWHITE); |
| 97 canvas->DrawRoundRect(view->GetContentsBounds(), corner_radius_, paint); | 97 canvas->DrawRoundRect(view->GetContentsBounds(), corner_radius_, paint); |
| 98 } | 98 } |
| 99 | 99 |
| 100 private: | 100 private: |
| 101 const int corner_radius_; | 101 const int corner_radius_; |
| 102 | 102 |
| 103 DISALLOW_COPY_AND_ASSIGN(AppListOverlayBackground); | 103 DISALLOW_COPY_AND_ASSIGN(AppListOverlayBackground); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 121 void SetTarget(views::View* target) { | 121 void SetTarget(views::View* target) { |
| 122 if (target_) | 122 if (target_) |
| 123 StopObservingImplicitAnimations(); | 123 StopObservingImplicitAnimations(); |
| 124 target_ = target; | 124 target_ = target; |
| 125 } | 125 } |
| 126 | 126 |
| 127 void set_frame(views::BubbleFrameView* frame) { frame_ = frame; } | 127 void set_frame(views::BubbleFrameView* frame) { frame_ = frame; } |
| 128 | 128 |
| 129 private: | 129 private: |
| 130 // Overridden from ui::ImplicitAnimationObserver: | 130 // Overridden from ui::ImplicitAnimationObserver: |
| 131 virtual void OnImplicitAnimationsCompleted() OVERRIDE { | 131 virtual void OnImplicitAnimationsCompleted() override { |
| 132 if (target_) { | 132 if (target_) { |
| 133 target_->SetVisible(false); | 133 target_->SetVisible(false); |
| 134 target_ = NULL; | 134 target_ = NULL; |
| 135 | 135 |
| 136 // Should update the background by invoking SchedulePaint(). | 136 // Should update the background by invoking SchedulePaint(). |
| 137 if (frame_) | 137 if (frame_) |
| 138 frame_->SchedulePaint(); | 138 frame_->SchedulePaint(); |
| 139 } | 139 } |
| 140 } | 140 } |
| 141 | 141 |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 speech_view_->layer()->SetTransform(speech_transform); | 595 speech_view_->layer()->SetTransform(speech_transform); |
| 596 } | 596 } |
| 597 | 597 |
| 598 if (will_appear) | 598 if (will_appear) |
| 599 speech_view_->SetVisible(true); | 599 speech_view_->SetVisible(true); |
| 600 else | 600 else |
| 601 app_list_main_view_->SetVisible(true); | 601 app_list_main_view_->SetVisible(true); |
| 602 } | 602 } |
| 603 | 603 |
| 604 } // namespace app_list | 604 } // namespace app_list |
| OLD | NEW |