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/fullscreen_exit_bubble_views.h" | 5 #include "chrome/browser/ui/views/fullscreen_exit_bubble_views.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 return gfx::Rect(origin, size); | 356 return gfx::Rect(origin, size); |
357 } | 357 } |
358 | 358 |
359 gfx::Point FullscreenExitBubbleViews::GetCursorScreenPoint() { | 359 gfx::Point FullscreenExitBubbleViews::GetCursorScreenPoint() { |
360 gfx::Point cursor_pos = gfx::Screen::GetCursorScreenPoint(); | 360 gfx::Point cursor_pos = gfx::Screen::GetCursorScreenPoint(); |
361 views::View::ConvertPointToView(NULL, root_view_, &cursor_pos); | 361 views::View::ConvertPointToView(NULL, root_view_, &cursor_pos); |
362 return cursor_pos; | 362 return cursor_pos; |
363 } | 363 } |
364 | 364 |
365 bool FullscreenExitBubbleViews::WindowContainsPoint(gfx::Point pos) { | 365 bool FullscreenExitBubbleViews::WindowContainsPoint(gfx::Point pos) { |
366 return root_view_->HitTest(pos); | 366 return root_view_->HitTestPoint(pos); |
367 } | 367 } |
368 | 368 |
369 bool FullscreenExitBubbleViews::IsWindowActive() { | 369 bool FullscreenExitBubbleViews::IsWindowActive() { |
370 return root_view_->GetWidget()->IsActive(); | 370 return root_view_->GetWidget()->IsActive(); |
371 } | 371 } |
372 | 372 |
373 void FullscreenExitBubbleViews::Hide() { | 373 void FullscreenExitBubbleViews::Hide() { |
374 size_animation_->SetSlideDuration(kSlideOutDurationMs); | 374 size_animation_->SetSlideDuration(kSlideOutDurationMs); |
375 size_animation_->Hide(); | 375 size_animation_->Hide(); |
376 } | 376 } |
377 | 377 |
378 void FullscreenExitBubbleViews::Show() { | 378 void FullscreenExitBubbleViews::Show() { |
379 size_animation_->SetSlideDuration(kSlideInDurationMs); | 379 size_animation_->SetSlideDuration(kSlideInDurationMs); |
380 size_animation_->Show(); | 380 size_animation_->Show(); |
381 } | 381 } |
382 | 382 |
383 bool FullscreenExitBubbleViews::IsAnimating() { | 383 bool FullscreenExitBubbleViews::IsAnimating() { |
384 return size_animation_->GetCurrentValue() != 0; | 384 return size_animation_->GetCurrentValue() != 0; |
385 } | 385 } |
386 | 386 |
387 void FullscreenExitBubbleViews::StartWatchingMouseIfNecessary() { | 387 void FullscreenExitBubbleViews::StartWatchingMouseIfNecessary() { |
388 if (!fullscreen_bubble::ShowButtonsForType(bubble_type_)) | 388 if (!fullscreen_bubble::ShowButtonsForType(bubble_type_)) |
389 StartWatchingMouse(); | 389 StartWatchingMouse(); |
390 } | 390 } |
OLD | NEW |