OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2009, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2009, 2011 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) |
4 * Copyright (C) 2012, Samsung Electronics. All rights reserved. | 4 * Copyright (C) 2012, Samsung Electronics. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 Chrome::~Chrome() | 72 Chrome::~Chrome() |
73 { | 73 { |
74 m_client->chromeDestroyed(); | 74 m_client->chromeDestroyed(); |
75 } | 75 } |
76 | 76 |
77 PassOwnPtr<Chrome> Chrome::create(Page* page, ChromeClient* client) | 77 PassOwnPtr<Chrome> Chrome::create(Page* page, ChromeClient* client) |
78 { | 78 { |
79 return adoptPtr(new Chrome(page, client)); | 79 return adoptPtr(new Chrome(page, client)); |
80 } | 80 } |
81 | 81 |
82 void Chrome::invalidateRootView(const IntRect& updateRect) | |
83 { | |
84 m_client->invalidateRootView(updateRect); | |
85 } | |
86 | |
87 void Chrome::invalidateContentsAndRootView(const IntRect& updateRect) | 82 void Chrome::invalidateContentsAndRootView(const IntRect& updateRect) |
88 { | 83 { |
89 m_client->invalidateContentsAndRootView(updateRect); | 84 m_client->invalidateContentsAndRootView(updateRect); |
90 } | 85 } |
91 | 86 |
92 void Chrome::invalidateContentsForSlowScroll(const IntRect& updateRect) | 87 void Chrome::invalidateContentsForSlowScroll(const IntRect& updateRect) |
93 { | 88 { |
94 m_client->invalidateContentsForSlowScroll(updateRect); | 89 m_client->invalidateContentsForSlowScroll(updateRect); |
95 } | 90 } |
96 | 91 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 void Chrome::takeFocus(FocusDirection direction) const | 163 void Chrome::takeFocus(FocusDirection direction) const |
169 { | 164 { |
170 m_client->takeFocus(direction); | 165 m_client->takeFocus(direction); |
171 } | 166 } |
172 | 167 |
173 void Chrome::focusedNodeChanged(Node* node) const | 168 void Chrome::focusedNodeChanged(Node* node) const |
174 { | 169 { |
175 m_client->focusedNodeChanged(node); | 170 m_client->focusedNodeChanged(node); |
176 } | 171 } |
177 | 172 |
178 void Chrome::focusedFrameChanged(Frame* frame) const | |
179 { | |
180 m_client->focusedFrameChanged(frame); | |
181 } | |
182 | |
183 Page* Chrome::createWindow(Frame* frame, const FrameLoadRequest& request, const
WindowFeatures& features, const NavigationAction& action) const | 173 Page* Chrome::createWindow(Frame* frame, const FrameLoadRequest& request, const
WindowFeatures& features, const NavigationAction& action) const |
184 { | 174 { |
185 Page* newPage = m_client->createWindow(frame, request, features, action); | 175 Page* newPage = m_client->createWindow(frame, request, features, action); |
186 | 176 |
187 if (newPage) { | 177 if (newPage) { |
188 if (StorageNamespace* oldSessionStorage = m_page->sessionStorage(false)) | 178 if (StorageNamespace* oldSessionStorage = m_page->sessionStorage(false)) |
189 newPage->setSessionStorage(oldSessionStorage->copy()); | 179 newPage->setSessionStorage(oldSessionStorage->copy()); |
190 } | 180 } |
191 | 181 |
192 return newPage; | 182 return newPage; |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 | 343 |
354 return ok; | 344 return ok; |
355 } | 345 } |
356 | 346 |
357 void Chrome::setStatusbarText(Frame* frame, const String& status) | 347 void Chrome::setStatusbarText(Frame* frame, const String& status) |
358 { | 348 { |
359 ASSERT(frame); | 349 ASSERT(frame); |
360 m_client->setStatusbarText(frame->displayStringModifiedByEncoding(status)); | 350 m_client->setStatusbarText(frame->displayStringModifiedByEncoding(status)); |
361 } | 351 } |
362 | 352 |
363 bool Chrome::shouldInterruptJavaScript() | |
364 { | |
365 // Defer loads in case the client method runs a new event loop that would | |
366 // otherwise cause the load to continue while we're in the middle of executi
ng JavaScript. | |
367 PageGroupLoadDeferrer deferrer(m_page, true); | |
368 | |
369 return m_client->shouldInterruptJavaScript(); | |
370 } | |
371 | |
372 IntRect Chrome::windowResizerRect() const | 353 IntRect Chrome::windowResizerRect() const |
373 { | 354 { |
374 return m_client->windowResizerRect(); | 355 return m_client->windowResizerRect(); |
375 } | 356 } |
376 | 357 |
377 void Chrome::mouseDidMoveOverElement(const HitTestResult& result, unsigned modif
ierFlags) | 358 void Chrome::mouseDidMoveOverElement(const HitTestResult& result, unsigned modif
ierFlags) |
378 { | 359 { |
379 if (result.innerNode()) { | 360 if (result.innerNode()) { |
380 Document* document = result.innerNode()->document(); | 361 Document* document = result.innerNode()->document(); |
381 if (document && document->isDNSPrefetchEnabled()) | 362 if (document && document->isDNSPrefetchEnabled()) |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 { | 479 { |
499 ASSERT_NOT_REACHED(); | 480 ASSERT_NOT_REACHED(); |
500 return String(); | 481 return String(); |
501 } | 482 } |
502 | 483 |
503 bool ChromeClient::paintCustomOverhangArea(GraphicsContext*, const IntRect&, con
st IntRect&, const IntRect&) | 484 bool ChromeClient::paintCustomOverhangArea(GraphicsContext*, const IntRect&, con
st IntRect&, const IntRect&) |
504 { | 485 { |
505 return false; | 486 return false; |
506 } | 487 } |
507 | 488 |
508 bool Chrome::selectItemWritingDirectionIsNatural() | |
509 { | |
510 return m_client->selectItemWritingDirectionIsNatural(); | |
511 } | |
512 | |
513 bool Chrome::selectItemAlignmentFollowsMenuWritingDirection() | |
514 { | |
515 return m_client->selectItemAlignmentFollowsMenuWritingDirection(); | |
516 } | |
517 | |
518 bool Chrome::hasOpenedPopup() const | 489 bool Chrome::hasOpenedPopup() const |
519 { | 490 { |
520 return m_client->hasOpenedPopup(); | 491 return m_client->hasOpenedPopup(); |
521 } | 492 } |
522 | 493 |
523 PassRefPtr<PopupMenu> Chrome::createPopupMenu(PopupMenuClient* client) const | 494 PassRefPtr<PopupMenu> Chrome::createPopupMenu(PopupMenuClient* client) const |
524 { | 495 { |
525 notifyPopupOpeningObservers(); | 496 notifyPopupOpeningObservers(); |
526 return m_client->createPopupMenu(client); | 497 return m_client->createPopupMenu(client); |
527 } | 498 } |
528 | 499 |
529 PassRefPtr<SearchPopupMenu> Chrome::createSearchPopupMenu(PopupMenuClient* clien
t) const | 500 PassRefPtr<SearchPopupMenu> Chrome::createSearchPopupMenu(PopupMenuClient* clien
t) const |
530 { | 501 { |
531 notifyPopupOpeningObservers(); | 502 notifyPopupOpeningObservers(); |
532 return m_client->createSearchPopupMenu(client); | 503 return m_client->createSearchPopupMenu(client); |
533 } | 504 } |
534 | 505 |
535 bool Chrome::requiresFullscreenForVideoPlayback() | |
536 { | |
537 return m_client->requiresFullscreenForVideoPlayback(); | |
538 } | |
539 | |
540 void Chrome::registerPopupOpeningObserver(PopupOpeningObserver* observer) | 506 void Chrome::registerPopupOpeningObserver(PopupOpeningObserver* observer) |
541 { | 507 { |
542 ASSERT(observer); | 508 ASSERT(observer); |
543 m_popupOpeningObservers.append(observer); | 509 m_popupOpeningObservers.append(observer); |
544 } | 510 } |
545 | 511 |
546 void Chrome::unregisterPopupOpeningObserver(PopupOpeningObserver* observer) | 512 void Chrome::unregisterPopupOpeningObserver(PopupOpeningObserver* observer) |
547 { | 513 { |
548 size_t index = m_popupOpeningObservers.find(observer); | 514 size_t index = m_popupOpeningObservers.find(observer); |
549 ASSERT(index != notFound); | 515 ASSERT(index != notFound); |
550 m_popupOpeningObservers.remove(index); | 516 m_popupOpeningObservers.remove(index); |
551 } | 517 } |
552 | 518 |
553 void Chrome::notifyPopupOpeningObservers() const | 519 void Chrome::notifyPopupOpeningObservers() const |
554 { | 520 { |
555 const Vector<PopupOpeningObserver*> observers(m_popupOpeningObservers); | 521 const Vector<PopupOpeningObserver*> observers(m_popupOpeningObservers); |
556 for (size_t i = 0; i < observers.size(); ++i) | 522 for (size_t i = 0; i < observers.size(); ++i) |
557 observers[i]->willOpenPopup(); | 523 observers[i]->willOpenPopup(); |
558 } | 524 } |
559 | 525 |
560 } // namespace WebCore | 526 } // namespace WebCore |
OLD | NEW |