| 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 "chrome/browser/ui/views/exclusive_access_bubble_views.h" | 5 #include "chrome/browser/ui/views/exclusive_access_bubble_views.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 } | 187 } |
| 188 view_->UpdateContent(exit_instruction_text, link_text); | 188 view_->UpdateContent(exit_instruction_text, link_text); |
| 189 } | 189 } |
| 190 | 190 |
| 191 views::View* ExclusiveAccessBubbleViews::GetBrowserRootView() const { | 191 views::View* ExclusiveAccessBubbleViews::GetBrowserRootView() const { |
| 192 return bubble_view_context_->GetBubbleAssociatedWidget()->GetRootView(); | 192 return bubble_view_context_->GetBubbleAssociatedWidget()->GetRootView(); |
| 193 } | 193 } |
| 194 | 194 |
| 195 void ExclusiveAccessBubbleViews::AnimationProgressed( | 195 void ExclusiveAccessBubbleViews::AnimationProgressed( |
| 196 const gfx::Animation* animation) { | 196 const gfx::Animation* animation) { |
| 197 int opacity = animation_->CurrentValueBetween(0, 255); | 197 float opacity = static_cast<float>(animation_->CurrentValueBetween(0.0, 1.0)); |
| 198 if (opacity == 0) { | 198 if (opacity == 0) { |
| 199 popup_->Hide(); | 199 popup_->Hide(); |
| 200 } else { | 200 } else { |
| 201 popup_->Show(); | 201 popup_->Show(); |
| 202 popup_->SetOpacity(opacity); | 202 popup_->SetOpacity(opacity); |
| 203 } | 203 } |
| 204 } | 204 } |
| 205 | 205 |
| 206 void ExclusiveAccessBubbleViews::AnimationEnded( | 206 void ExclusiveAccessBubbleViews::AnimationEnded( |
| 207 const gfx::Animation* animation) { | 207 const gfx::Animation* animation) { |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 void ExclusiveAccessBubbleViews::OnWidgetVisibilityChanged( | 276 void ExclusiveAccessBubbleViews::OnWidgetVisibilityChanged( |
| 277 views::Widget* widget, | 277 views::Widget* widget, |
| 278 bool visible) { | 278 bool visible) { |
| 279 UpdateMouseWatcher(); | 279 UpdateMouseWatcher(); |
| 280 } | 280 } |
| 281 | 281 |
| 282 void ExclusiveAccessBubbleViews::LinkClicked(views::Link* link, | 282 void ExclusiveAccessBubbleViews::LinkClicked(views::Link* link, |
| 283 int event_flags) { | 283 int event_flags) { |
| 284 ExitExclusiveAccess(); | 284 ExitExclusiveAccess(); |
| 285 } | 285 } |
| OLD | NEW |