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

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

Issue 209353003: Clean up handling of autosizing state changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@crap_base
Patch Set: Address review comments. Created 6 years, 9 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
OLDNEW
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #include "core/page/ChromeClient.h" 45 #include "core/page/ChromeClient.h"
46 #include "core/page/ContextMenuController.h" 46 #include "core/page/ContextMenuController.h"
47 #include "core/page/DragController.h" 47 #include "core/page/DragController.h"
48 #include "core/page/FocusController.h" 48 #include "core/page/FocusController.h"
49 #include "core/page/FrameTree.h" 49 #include "core/page/FrameTree.h"
50 #include "core/page/PageLifecycleNotifier.h" 50 #include "core/page/PageLifecycleNotifier.h"
51 #include "core/page/PointerLockController.h" 51 #include "core/page/PointerLockController.h"
52 #include "core/page/StorageClient.h" 52 #include "core/page/StorageClient.h"
53 #include "core/page/ValidationMessageClient.h" 53 #include "core/page/ValidationMessageClient.h"
54 #include "core/page/scrolling/ScrollingCoordinator.h" 54 #include "core/page/scrolling/ScrollingCoordinator.h"
55 #include "core/rendering/FastTextAutosizer.h"
55 #include "core/rendering/RenderView.h" 56 #include "core/rendering/RenderView.h"
56 #include "core/rendering/TextAutosizer.h" 57 #include "core/rendering/TextAutosizer.h"
57 #include "core/storage/StorageNamespace.h" 58 #include "core/storage/StorageNamespace.h"
58 #include "platform/plugins/PluginData.h" 59 #include "platform/plugins/PluginData.h"
59 #include "wtf/HashMap.h" 60 #include "wtf/HashMap.h"
60 #include "wtf/RefCountedLeakCounter.h" 61 #include "wtf/RefCountedLeakCounter.h"
61 #include "wtf/StdLibExtras.h" 62 #include "wtf/StdLibExtras.h"
62 #include "wtf/text/Base64.h" 63 #include "wtf/text/Base64.h"
63 64
64 namespace WebCore { 65 namespace WebCore {
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 (*it)->multisamplingChanged(m_settings->openGLMultisamplingEnabled() ); 483 (*it)->multisamplingChanged(m_settings->openGLMultisamplingEnabled() );
483 break; 484 break;
484 } 485 }
485 case SettingsDelegate::ImageLoadingChange: 486 case SettingsDelegate::ImageLoadingChange:
486 for (LocalFrame* frame = mainFrame(); frame; frame = frame->tree().trave rseNext()) { 487 for (LocalFrame* frame = mainFrame(); frame; frame = frame->tree().trave rseNext()) {
487 frame->document()->fetcher()->setImagesEnabled(settings().imagesEnab led()); 488 frame->document()->fetcher()->setImagesEnabled(settings().imagesEnab led());
488 frame->document()->fetcher()->setAutoLoadImages(settings().loadsImag esAutomatically()); 489 frame->document()->fetcher()->setAutoLoadImages(settings().loadsImag esAutomatically());
489 } 490 }
490 break; 491 break;
491 case SettingsDelegate::TextAutosizingChange: 492 case SettingsDelegate::TextAutosizingChange:
492 // FTA needs both setNeedsRecalcStyle and setNeedsLayout after a setting change. 493 if (!mainFrame())
493 if (RuntimeEnabledFeatures::fastTextAutosizingEnabled()) { 494 break;
494 setNeedsRecalcStyleInAllFrames(); 495 if (FastTextAutosizer* textAutosizer = mainFrame()->document()->fastText Autosizer()) {
496 textAutosizer->updatePageInfoInAllFrames();
495 } else { 497 } else {
496 // FIXME: I wonder if this needs to traverse frames like in WebViewI mpl::resize, or whether there is only one document per Settings instance?
497 for (LocalFrame* frame = mainFrame(); frame; frame = frame->tree().t raverseNext()) { 498 for (LocalFrame* frame = mainFrame(); frame; frame = frame->tree().t raverseNext()) {
498 TextAutosizer* textAutosizer = frame->document()->textAutosizer( ); 499 if (TextAutosizer* textAutosizer = frame->document()->textAutosi zer())
499 if (textAutosizer)
500 textAutosizer->recalculateMultipliers(); 500 textAutosizer->recalculateMultipliers();
501 } 501 }
502 // TextAutosizing updates RenderStyle during layout phase (via TextA utosizer::processSubtree).
503 // We should invoke setNeedsLayout here.
504 setNeedsLayoutInAllFrames();
502 } 505 }
503 // TextAutosizing updates RenderStyle during layout phase (via TextAutos izer::processSubtree).
504 // We should invoke setNeedsLayout here.
505 setNeedsLayoutInAllFrames();
506 break; 506 break;
507 case SettingsDelegate::ScriptEnableChange: 507 case SettingsDelegate::ScriptEnableChange:
508 m_inspectorController->scriptsEnabled(settings().scriptEnabled()); 508 m_inspectorController->scriptsEnabled(settings().scriptEnabled());
509 break; 509 break;
510 case SettingsDelegate::FontFamilyChange: 510 case SettingsDelegate::FontFamilyChange:
511 for (LocalFrame* frame = mainFrame(); frame; frame = frame->tree().trave rseNext()) 511 for (LocalFrame* frame = mainFrame(); frame; frame = frame->tree().trave rseNext())
512 frame->document()->styleEngine()->updateGenericFontFamilySettings(); 512 frame->document()->styleEngine()->updateGenericFontFamilySettings();
513 setNeedsRecalcStyleInAllFrames(); 513 setNeedsRecalcStyleInAllFrames();
514 break; 514 break;
515 } 515 }
(...skipping 28 matching lines...) Expand all
544 , spellCheckerClient(0) 544 , spellCheckerClient(0)
545 , storageClient(0) 545 , storageClient(0)
546 { 546 {
547 } 547 }
548 548
549 Page::PageClients::~PageClients() 549 Page::PageClients::~PageClients()
550 { 550 {
551 } 551 }
552 552
553 } // namespace WebCore 553 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698