| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
| 5 * 2000 Simon Hausmann <hausmann@kde.org> | 5 * 2000 Simon Hausmann <hausmann@kde.org> |
| 6 * 2000 Stefan Schimanski <1Stein@gmx.de> | 6 * 2000 Stefan Schimanski <1Stein@gmx.de> |
| 7 * 2001 George Staikos <staikos@kde.org> | 7 * 2001 George Staikos <staikos@kde.org> |
| 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All | 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
| 9 * rights reserved. | 9 * rights reserved. |
| 10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> | 10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 void LocalFrame::Init() { | 282 void LocalFrame::Init() { |
| 283 DCHECK(!GetInitializationVector().IsEmpty()); | 283 DCHECK(!GetInitializationVector().IsEmpty()); |
| 284 for (auto& initilization_callback : GetInitializationVector()) { | 284 for (auto& initilization_callback : GetInitializationVector()) { |
| 285 initilization_callback(this); | 285 initilization_callback(this); |
| 286 } | 286 } |
| 287 | 287 |
| 288 loader_.Init(); | 288 loader_.Init(); |
| 289 } | 289 } |
| 290 | 290 |
| 291 void LocalFrame::SetView(FrameView* view) { | 291 void LocalFrame::SetView(FrameView* view) { |
| 292 ASSERT(!view_ || view_ != view); | 292 DCHECK(!view_ || view_ != view); |
| 293 ASSERT(!GetDocument() || !GetDocument()->IsActive()); | 293 DCHECK(!GetDocument() || !GetDocument()->IsActive()); |
| 294 | 294 |
| 295 GetEventHandler().Clear(); | 295 GetEventHandler().Clear(); |
| 296 | 296 |
| 297 view_ = view; | 297 view_ = view; |
| 298 } | 298 } |
| 299 | 299 |
| 300 void LocalFrame::CreateView(const IntSize& viewport_size, | 300 void LocalFrame::CreateView(const IntSize& viewport_size, |
| 301 const Color& background_color, | 301 const Color& background_color, |
| 302 ScrollbarMode horizontal_scrollbar_mode, | 302 ScrollbarMode horizontal_scrollbar_mode, |
| 303 bool horizontal_lock, | 303 bool horizontal_lock, |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 if (ContentLayoutItem().IsNull()) | 642 if (ContentLayoutItem().IsNull()) |
| 643 return FloatSize(); | 643 return FloatSize(); |
| 644 | 644 |
| 645 if (ContentLayoutItem().Style()->IsHorizontalWritingMode()) { | 645 if (ContentLayoutItem().Style()->IsHorizontalWritingMode()) { |
| 646 DCHECK_GT(fabs(original_size.Width()), | 646 DCHECK_GT(fabs(original_size.Width()), |
| 647 std::numeric_limits<float>::epsilon()); | 647 std::numeric_limits<float>::epsilon()); |
| 648 float ratio = original_size.Height() / original_size.Width(); | 648 float ratio = original_size.Height() / original_size.Width(); |
| 649 result_size.SetWidth(floorf(expected_size.Width())); | 649 result_size.SetWidth(floorf(expected_size.Width())); |
| 650 result_size.SetHeight(floorf(result_size.Width() * ratio)); | 650 result_size.SetHeight(floorf(result_size.Width() * ratio)); |
| 651 } else { | 651 } else { |
| 652 ASSERT(fabs(original_size.Height()) > | 652 DCHECK_GT(fabs(original_size.Height()), |
| 653 std::numeric_limits<float>::epsilon()); | 653 std::numeric_limits<float>::epsilon()); |
| 654 float ratio = original_size.Width() / original_size.Height(); | 654 float ratio = original_size.Width() / original_size.Height(); |
| 655 result_size.SetHeight(floorf(expected_size.Height())); | 655 result_size.SetHeight(floorf(expected_size.Height())); |
| 656 result_size.SetWidth(floorf(result_size.Height() * ratio)); | 656 result_size.SetWidth(floorf(result_size.Height() * ratio)); |
| 657 } | 657 } |
| 658 return result_size; | 658 return result_size; |
| 659 } | 659 } |
| 660 | 660 |
| 661 void LocalFrame::SetPageZoomFactor(float factor) { | 661 void LocalFrame::SetPageZoomFactor(float factor) { |
| 662 SetPageAndTextZoomFactors(factor, text_zoom_factor_); | 662 SetPageAndTextZoomFactors(factor, text_zoom_factor_); |
| 663 } | 663 } |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 969 WebURLRequest::kClientLoFiOn); | 969 WebURLRequest::kClientLoFiOn); |
| 970 params.SetAllowImagePlaceholder(); | 970 params.SetAllowImagePlaceholder(); |
| 971 } | 971 } |
| 972 } | 972 } |
| 973 | 973 |
| 974 std::unique_ptr<WebURLLoader> LocalFrame::CreateURLLoader() { | 974 std::unique_ptr<WebURLLoader> LocalFrame::CreateURLLoader() { |
| 975 return Client()->CreateURLLoader(); | 975 return Client()->CreateURLLoader(); |
| 976 } | 976 } |
| 977 | 977 |
| 978 } // namespace blink | 978 } // namespace blink |
| OLD | NEW |