| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/views/blocked_popup_container_view_win.h" | 5 #include "chrome/browser/views/blocked_popup_container_view_win.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 | 9 |
| 10 #include "app/gfx/canvas.h" | 10 #include "app/gfx/canvas.h" |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 // the horizontal scroll bar. Fixing this is half of | 337 // the horizontal scroll bar. Fixing this is half of |
| 338 // http://b/1118139. | 338 // http://b/1118139. |
| 339 gfx::Point anchor_point( | 339 gfx::Point anchor_point( |
| 340 client_rect.Width() - | 340 client_rect.Width() - |
| 341 views::NativeScrollBar::GetVerticalScrollBarWidth(), | 341 views::NativeScrollBar::GetVerticalScrollBarWidth(), |
| 342 client_rect.Height()); | 342 client_rect.Height()); |
| 343 | 343 |
| 344 gfx::Size size = container_view_->GetPreferredSize(); | 344 gfx::Size size = container_view_->GetPreferredSize(); |
| 345 int base_x = anchor_point.x() - size.width(); | 345 int base_x = anchor_point.x() - size.width(); |
| 346 int base_y = anchor_point.y() - size.height(); | 346 int base_y = anchor_point.y() - size.height(); |
| 347 // The bounds we report through the automation system are the real bounds; | |
| 348 // the animation is short lived... | |
| 349 bounds_ = gfx::Rect(gfx::Point(base_x, base_y), size); | |
| 350 | 347 |
| 351 int real_height = | 348 int real_height = |
| 352 static_cast<int>(size.height() * slide_animation_->GetCurrentValue()); | 349 static_cast<int>(size.height() * slide_animation_->GetCurrentValue()); |
| 353 int real_y = anchor_point.y() - real_height; | 350 int real_y = anchor_point.y() - real_height; |
| 354 | 351 |
| 355 if (real_height > 0) { | 352 if (real_height > 0) { |
| 356 int x; | 353 int x; |
| 357 if (l10n_util::GetTextDirection() == l10n_util::LEFT_TO_RIGHT) { | 354 if (l10n_util::GetTextDirection() == l10n_util::LEFT_TO_RIGHT) { |
| 358 // Size this window using the anchor point as top-right corner. | 355 // Size this window using the anchor point as top-right corner. |
| 359 x = base_x; | 356 x = base_x; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 void BlockedPopupContainerViewWin::OnSize(UINT param, const CSize& size) { | 406 void BlockedPopupContainerViewWin::OnSize(UINT param, const CSize& size) { |
| 410 // Set the window region so we have rounded corners on the top. | 407 // Set the window region so we have rounded corners on the top. |
| 411 SkRect rect; | 408 SkRect rect; |
| 412 rect.set(0, 0, SkIntToScalar(size.cx), SkIntToScalar(size.cy)); | 409 rect.set(0, 0, SkIntToScalar(size.cx), SkIntToScalar(size.cy)); |
| 413 gfx::Path path; | 410 gfx::Path path; |
| 414 path.addRoundRect(rect, kRoundedCornerRad, SkPath::kCW_Direction); | 411 path.addRoundRect(rect, kRoundedCornerRad, SkPath::kCW_Direction); |
| 415 SetWindowRgn(path.CreateHRGN(), TRUE); | 412 SetWindowRgn(path.CreateHRGN(), TRUE); |
| 416 | 413 |
| 417 ChangeSize(param, size); | 414 ChangeSize(param, size); |
| 418 } | 415 } |
| OLD | NEW |