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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
350 int popup_bottom = size_animation_->CurrentValueBetween( | 350 int popup_bottom = size_animation_->CurrentValueBetween( |
351 static_cast<double>(total_height), 0.0f); | 351 static_cast<double>(total_height), 0.0f); |
352 int y_offset = std::min(popup_bottom, kPopupTopPx); | 352 int y_offset = std::min(popup_bottom, kPopupTopPx); |
353 size.set_height(size.height() - popup_bottom + y_offset); | 353 size.set_height(size.height() - popup_bottom + y_offset); |
354 origin.set_y(origin.y() - y_offset); | 354 origin.set_y(origin.y() - y_offset); |
355 } | 355 } |
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 gfx::Screen::BadTwoWorldsContext()); | |
oshima
2012/10/04 20:18:26
root_view_->GetWidget()->GetNativeView()?
| |
361 views::View::ConvertPointToTarget(NULL, root_view_, &cursor_pos); | 362 views::View::ConvertPointToTarget(NULL, root_view_, &cursor_pos); |
362 return cursor_pos; | 363 return cursor_pos; |
363 } | 364 } |
364 | 365 |
365 bool FullscreenExitBubbleViews::WindowContainsPoint(gfx::Point pos) { | 366 bool FullscreenExitBubbleViews::WindowContainsPoint(gfx::Point pos) { |
366 return root_view_->HitTestPoint(pos); | 367 return root_view_->HitTestPoint(pos); |
367 } | 368 } |
368 | 369 |
369 bool FullscreenExitBubbleViews::IsWindowActive() { | 370 bool FullscreenExitBubbleViews::IsWindowActive() { |
370 return root_view_->GetWidget()->IsActive(); | 371 return root_view_->GetWidget()->IsActive(); |
(...skipping 10 matching lines...) Expand all Loading... | |
381 } | 382 } |
382 | 383 |
383 bool FullscreenExitBubbleViews::IsAnimating() { | 384 bool FullscreenExitBubbleViews::IsAnimating() { |
384 return size_animation_->GetCurrentValue() != 0; | 385 return size_animation_->GetCurrentValue() != 0; |
385 } | 386 } |
386 | 387 |
387 void FullscreenExitBubbleViews::StartWatchingMouseIfNecessary() { | 388 void FullscreenExitBubbleViews::StartWatchingMouseIfNecessary() { |
388 if (!fullscreen_bubble::ShowButtonsForType(bubble_type_)) | 389 if (!fullscreen_bubble::ShowButtonsForType(bubble_type_)) |
389 StartWatchingMouse(); | 390 StartWatchingMouse(); |
390 } | 391 } |
OLD | NEW |