OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R
ights Reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R
ights Reserved. |
3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 { | 273 { |
274 m_openedByDOM = true; | 274 m_openedByDOM = true; |
275 } | 275 } |
276 | 276 |
277 void Page::goToItem(HistoryItem* item) | 277 void Page::goToItem(HistoryItem* item) |
278 { | 278 { |
279 // stopAllLoaders may end up running onload handlers, which could cause furt
her history traversals that may lead to the passed in HistoryItem | 279 // stopAllLoaders may end up running onload handlers, which could cause furt
her history traversals that may lead to the passed in HistoryItem |
280 // being deref()-ed. Make sure we can still use it with HistoryController::g
oToItem later. | 280 // being deref()-ed. Make sure we can still use it with HistoryController::g
oToItem later. |
281 RefPtr<HistoryItem> protector(item); | 281 RefPtr<HistoryItem> protector(item); |
282 | 282 |
283 if (m_mainFrame->loader()->history()->shouldStopLoadingForHistoryItem(item)) | 283 if (m_mainFrame->loader().history()->shouldStopLoadingForHistoryItem(item)) |
284 m_mainFrame->loader()->stopAllLoaders(); | 284 m_mainFrame->loader().stopAllLoaders(); |
285 | 285 |
286 m_mainFrame->loader()->history()->goToItem(item); | 286 m_mainFrame->loader().history()->goToItem(item); |
287 } | 287 } |
288 | 288 |
289 void Page::clearPageGroup() | 289 void Page::clearPageGroup() |
290 { | 290 { |
291 if (!m_group) | 291 if (!m_group) |
292 return; | 292 return; |
293 m_group->removePage(this); | 293 m_group->removePage(this); |
294 m_group = 0; | 294 m_group = 0; |
295 } | 295 } |
296 | 296 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 Page* page = *it; | 343 Page* page = *it; |
344 | 344 |
345 // Clear out the page's plug-in data. | 345 // Clear out the page's plug-in data. |
346 if (page->m_pluginData) | 346 if (page->m_pluginData) |
347 page->m_pluginData = 0; | 347 page->m_pluginData = 0; |
348 | 348 |
349 if (!reload) | 349 if (!reload) |
350 continue; | 350 continue; |
351 | 351 |
352 for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree().tra
verseNext()) { | 352 for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree().tra
verseNext()) { |
353 if (frame->loader()->containsPlugins()) | 353 if (frame->loader().containsPlugins()) |
354 framesNeedingReload.append(frame); | 354 framesNeedingReload.append(frame); |
355 } | 355 } |
356 } | 356 } |
357 | 357 |
358 for (size_t i = 0; i < framesNeedingReload.size(); ++i) | 358 for (size_t i = 0; i < framesNeedingReload.size(); ++i) |
359 framesNeedingReload[i]->loader()->reload(); | 359 framesNeedingReload[i]->loader().reload(); |
360 } | 360 } |
361 | 361 |
362 PluginData* Page::pluginData() const | 362 PluginData* Page::pluginData() const |
363 { | 363 { |
364 if (!mainFrame()->loader()->allowPlugins(NotAboutToInstantiatePlugin)) | 364 if (!mainFrame()->loader().allowPlugins(NotAboutToInstantiatePlugin)) |
365 return 0; | 365 return 0; |
366 if (!m_pluginData) | 366 if (!m_pluginData) |
367 m_pluginData = PluginData::create(this); | 367 m_pluginData = PluginData::create(this); |
368 return m_pluginData.get(); | 368 return m_pluginData.get(); |
369 } | 369 } |
370 | 370 |
371 static Frame* incrementFrame(Frame* curr, bool forward, bool wrapFlag) | 371 static Frame* incrementFrame(Frame* curr, bool forward, bool wrapFlag) |
372 { | 372 { |
373 return forward | 373 return forward |
374 ? curr->tree().traverseNextWithWrap(wrapFlag) | 374 ? curr->tree().traverseNextWithWrap(wrapFlag) |
(...skipping 12 matching lines...) Expand all Loading... |
387 } while (frame); | 387 } while (frame); |
388 } | 388 } |
389 | 389 |
390 void Page::setDefersLoading(bool defers) | 390 void Page::setDefersLoading(bool defers) |
391 { | 391 { |
392 if (defers == m_defersLoading) | 392 if (defers == m_defersLoading) |
393 return; | 393 return; |
394 | 394 |
395 m_defersLoading = defers; | 395 m_defersLoading = defers; |
396 for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()
) | 396 for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()
) |
397 frame->loader()->setDefersLoading(defers); | 397 frame->loader().setDefersLoading(defers); |
398 } | 398 } |
399 | 399 |
400 void Page::setPageScaleFactor(float scale, const IntPoint& origin) | 400 void Page::setPageScaleFactor(float scale, const IntPoint& origin) |
401 { | 401 { |
402 FrameView* view = mainFrame()->view(); | 402 FrameView* view = mainFrame()->view(); |
403 | 403 |
404 if (scale != m_pageScaleFactor) { | 404 if (scale != m_pageScaleFactor) { |
405 m_pageScaleFactor = scale; | 405 m_pageScaleFactor = scale; |
406 | 406 |
407 if (view) | 407 if (view) |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 , inspectorClient(0) | 612 , inspectorClient(0) |
613 , backForwardClient(0) | 613 , backForwardClient(0) |
614 { | 614 { |
615 } | 615 } |
616 | 616 |
617 Page::PageClients::~PageClients() | 617 Page::PageClients::~PageClients() |
618 { | 618 { |
619 } | 619 } |
620 | 620 |
621 } // namespace WebCore | 621 } // namespace WebCore |
OLD | NEW |