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

Side by Side Diff: Source/core/page/DOMWindow.cpp

Issue 22955006: Chrome::client() should return a ChromeClient reference. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/page/CreateWindow.cpp ('k') | Source/core/page/Frame.cpp » ('j') | 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) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 // Update window values if new requested values are not NaN. 258 // Update window values if new requested values are not NaN.
259 if (!std::isnan(pendingChanges.x())) 259 if (!std::isnan(pendingChanges.x()))
260 window.setX(pendingChanges.x()); 260 window.setX(pendingChanges.x());
261 if (!std::isnan(pendingChanges.y())) 261 if (!std::isnan(pendingChanges.y()))
262 window.setY(pendingChanges.y()); 262 window.setY(pendingChanges.y());
263 if (!std::isnan(pendingChanges.width())) 263 if (!std::isnan(pendingChanges.width()))
264 window.setWidth(pendingChanges.width()); 264 window.setWidth(pendingChanges.width());
265 if (!std::isnan(pendingChanges.height())) 265 if (!std::isnan(pendingChanges.height()))
266 window.setHeight(pendingChanges.height()); 266 window.setHeight(pendingChanges.height());
267 267
268 FloatSize minimumSize = page->chrome().client()->minimumWindowSize(); 268 FloatSize minimumSize = page->chrome().client().minimumWindowSize();
269 // Let size 0 pass through, since that indicates default size, not minimum s ize. 269 // Let size 0 pass through, since that indicates default size, not minimum s ize.
270 if (window.width()) 270 if (window.width())
271 window.setWidth(min(max(minimumSize.width(), window.width()), screen.wid th())); 271 window.setWidth(min(max(minimumSize.width(), window.width()), screen.wid th()));
272 if (window.height()) 272 if (window.height())
273 window.setHeight(min(max(minimumSize.height(), window.height()), screen. height())); 273 window.setHeight(min(max(minimumSize.height(), window.height()), screen. height()));
274 274
275 // Constrain the window position within the valid screen area. 275 // Constrain the window position within the valid screen area.
276 window.setX(max(screen.x(), min(window.x(), screen.maxX() - window.width())) ); 276 window.setX(max(screen.x(), min(window.x(), screen.maxX() - window.width())) );
277 window.setY(max(screen.y(), min(window.y(), screen.maxY() - window.height()) )); 277 window.setY(max(screen.y(), min(window.y(), screen.maxY() - window.height()) ));
278 278
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_frame- >view(), VerticalScrollbar); 355 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_frame- >view(), VerticalScrollbar);
356 scrollingCoordinator->scrollableAreaScrollLayerDidChange(m_frame->vi ew()); 356 scrollingCoordinator->scrollableAreaScrollLayerDidChange(m_frame->vi ew());
357 } 357 }
358 } 358 }
359 359
360 m_frame->selection()->updateSecureKeyboardEntryIfActive(); 360 m_frame->selection()->updateSecureKeyboardEntryIfActive();
361 361
362 if (m_frame->page() && m_frame->page()->mainFrame() == m_frame) { 362 if (m_frame->page() && m_frame->page()->mainFrame() == m_frame) {
363 m_frame->page()->mainFrame()->notifyChromeClientWheelEventHandlerCountCh anged(); 363 m_frame->page()->mainFrame()->notifyChromeClientWheelEventHandlerCountCh anged();
364 if (m_document->hasTouchEventHandlers()) 364 if (m_document->hasTouchEventHandlers())
365 m_frame->page()->chrome().client()->needTouchEvents(true); 365 m_frame->page()->chrome().client().needTouchEvents(true);
366 } 366 }
367 } 367 }
368 368
369 DOMWindow::~DOMWindow() 369 DOMWindow::~DOMWindow()
370 { 370 {
371 ASSERT(!m_screen); 371 ASSERT(!m_screen);
372 ASSERT(!m_history); 372 ASSERT(!m_history);
373 ASSERT(!m_locationbar); 373 ASSERT(!m_locationbar);
374 ASSERT(!m_menubar); 374 ASSERT(!m_menubar);
375 ASSERT(!m_personalbar); 375 ASSERT(!m_personalbar);
(...skipping 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after
1761 return static_cast<DOMWindowLifecycleNotifier*>(LifecycleContext::lifecycleN otifier()); 1761 return static_cast<DOMWindowLifecycleNotifier*>(LifecycleContext::lifecycleN otifier());
1762 } 1762 }
1763 1763
1764 PassOwnPtr<LifecycleNotifier> DOMWindow::createLifecycleNotifier() 1764 PassOwnPtr<LifecycleNotifier> DOMWindow::createLifecycleNotifier()
1765 { 1765 {
1766 return DOMWindowLifecycleNotifier::create(this); 1766 return DOMWindowLifecycleNotifier::create(this);
1767 } 1767 }
1768 1768
1769 1769
1770 } // namespace WebCore 1770 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/CreateWindow.cpp ('k') | Source/core/page/Frame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698