Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Side by Side Diff: third_party/WebKit/Source/web/WebPagePopupImpl.cpp

Issue 2263503003: Set WebPagePopupImpl's bounds even if they don't appear to have changed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 PageWidgetDelegate::paint(*m_page, canvas, rect, *m_page->deprecatedLoca lMainFrame()); 412 PageWidgetDelegate::paint(*m_page, canvas, rect, *m_page->deprecatedLoca lMainFrame());
413 } 413 }
414 414
415 void WebPagePopupImpl::resize(const WebSize& newSizeInViewport) 415 void WebPagePopupImpl::resize(const WebSize& newSizeInViewport)
416 { 416 {
417 WebRect newSize(0, 0, newSizeInViewport.width, newSizeInViewport.height); 417 WebRect newSize(0, 0, newSizeInViewport.width, newSizeInViewport.height);
418 widgetClient()->convertViewportToWindow(&newSize); 418 widgetClient()->convertViewportToWindow(&newSize);
419 419
420 WebRect windowRect = windowRectInScreen(); 420 WebRect windowRect = windowRectInScreen();
421 421
422 if (windowRect.width != newSize.width 422 // TODO(bokan): We should only call into this if the bounds actually changed
423 && windowRect.height != newSize.height) { 423 // but this reveals a bug in Aura. crbug.com/633140.
424 windowRect.width = newSize.width; 424 windowRect.width = newSize.width;
425 windowRect.height = newSize.height; 425 windowRect.height = newSize.height;
426 setWindowRect(windowRect); 426 setWindowRect(windowRect);
427 }
428 427
429 if (m_page) { 428 if (m_page) {
430 toLocalFrame(m_page->mainFrame())->view()->resize(newSizeInViewport); 429 toLocalFrame(m_page->mainFrame())->view()->resize(newSizeInViewport);
431 m_page->frameHost().visualViewport().setSize(newSizeInViewport); 430 m_page->frameHost().visualViewport().setSize(newSizeInViewport);
432 } 431 }
433 432
434 m_widgetClient->didInvalidateRect(WebRect(0, 0, newSize.width, newSize.heigh t)); 433 m_widgetClient->didInvalidateRect(WebRect(0, 0, newSize.width, newSize.heigh t));
435 } 434 }
436 435
437 WebInputEventResult WebPagePopupImpl::handleKeyEvent(const WebKeyboardEvent& eve nt) 436 WebInputEventResult WebPagePopupImpl::handleKeyEvent(const WebKeyboardEvent& eve nt)
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 // A WebPagePopupImpl instance usually has two references. 581 // A WebPagePopupImpl instance usually has two references.
583 // - One owned by the instance itself. It represents the visible widget. 582 // - One owned by the instance itself. It represents the visible widget.
584 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the 583 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the
585 // WebPagePopupImpl to close. 584 // WebPagePopupImpl to close.
586 // We need them because the closing operation is asynchronous and the widget 585 // We need them because the closing operation is asynchronous and the widget
587 // can be closed while the WebViewImpl is unaware of it. 586 // can be closed while the WebViewImpl is unaware of it.
588 return adoptRef(new WebPagePopupImpl(client)).leakRef(); 587 return adoptRef(new WebPagePopupImpl(client)).leakRef();
589 } 588 }
590 589
591 } // namespace blink 590 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698