| 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 BlockedPopupContainerViewWin::BlockedPopupContainerViewWin( | 391 BlockedPopupContainerViewWin::BlockedPopupContainerViewWin( |
| 392 BlockedPopupContainer* container) | 392 BlockedPopupContainer* container) |
| 393 : slide_animation_(new SlideAnimation(this)), | 393 : slide_animation_(new SlideAnimation(this)), |
| 394 container_model_(container), | 394 container_model_(container), |
| 395 container_view_(NULL) { | 395 container_view_(NULL) { |
| 396 container_view_ = new BlockedPopupContainerInternalView(this); | 396 container_view_ = new BlockedPopupContainerInternalView(this); |
| 397 container_view_->SetVisible(true); | 397 container_view_->SetVisible(true); |
| 398 | 398 |
| 399 set_window_style(WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN); | 399 set_window_style(WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN); |
| 400 WidgetWin::Init(GetModel()->GetConstrainingContents(NULL)->GetNativeView(), | 400 WidgetWin::Init(GetModel()->GetConstrainingContents(NULL)->GetNativeView(), |
| 401 gfx::Rect()); | 401 gfx::Rect(), false); |
| 402 SetContentsView(container_view_); | 402 SetContentsView(container_view_); |
| 403 SetPosition(); | 403 SetPosition(); |
| 404 } | 404 } |
| 405 | 405 |
| 406 void BlockedPopupContainerViewWin::OnSize(UINT param, const CSize& size) { | 406 void BlockedPopupContainerViewWin::OnSize(UINT param, const CSize& size) { |
| 407 // 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. |
| 408 SkRect rect; | 408 SkRect rect; |
| 409 rect.set(0, 0, SkIntToScalar(size.cx), SkIntToScalar(size.cy)); | 409 rect.set(0, 0, SkIntToScalar(size.cx), SkIntToScalar(size.cy)); |
| 410 gfx::Path path; | 410 gfx::Path path; |
| 411 path.addRoundRect(rect, kRoundedCornerRad, SkPath::kCW_Direction); | 411 path.addRoundRect(rect, kRoundedCornerRad, SkPath::kCW_Direction); |
| 412 SetWindowRgn(path.CreateHRGN(), TRUE); | 412 SetWindowRgn(path.CreateHRGN(), TRUE); |
| 413 | 413 |
| 414 ChangeSize(param, size); | 414 ChangeSize(param, size); |
| 415 } | 415 } |
| OLD | NEW |