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

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 1050783003: Remove stylesheet injection from Blink. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Revert devtool removals Created 5 years, 8 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/web/AssertMatchingEnums.cpp ('k') | Source/web/tests/ViewportTest.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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 #include "core/loader/FrameLoader.h" 74 #include "core/loader/FrameLoader.h"
75 #include "core/page/Chrome.h" 75 #include "core/page/Chrome.h"
76 #include "core/page/ContextMenuController.h" 76 #include "core/page/ContextMenuController.h"
77 #include "core/page/ContextMenuProvider.h" 77 #include "core/page/ContextMenuProvider.h"
78 #include "core/page/DragController.h" 78 #include "core/page/DragController.h"
79 #include "core/page/DragData.h" 79 #include "core/page/DragData.h"
80 #include "core/page/DragSession.h" 80 #include "core/page/DragSession.h"
81 #include "core/page/EventHandler.h" 81 #include "core/page/EventHandler.h"
82 #include "core/page/FocusController.h" 82 #include "core/page/FocusController.h"
83 #include "core/page/FrameTree.h" 83 #include "core/page/FrameTree.h"
84 #include "core/page/InjectedStyleSheets.h"
85 #include "core/page/Page.h" 84 #include "core/page/Page.h"
86 #include "core/page/PagePopupClient.h" 85 #include "core/page/PagePopupClient.h"
87 #include "core/page/PointerLockController.h" 86 #include "core/page/PointerLockController.h"
88 #include "core/page/ScopedPageLoadDeferrer.h" 87 #include "core/page/ScopedPageLoadDeferrer.h"
89 #include "core/page/TouchDisambiguation.h" 88 #include "core/page/TouchDisambiguation.h"
90 #include "modules/accessibility/AXObject.h" 89 #include "modules/accessibility/AXObject.h"
91 #include "modules/accessibility/AXObjectCacheImpl.h" 90 #include "modules/accessibility/AXObjectCacheImpl.h"
92 #include "modules/credentialmanager/CredentialManagerClient.h" 91 #include "modules/credentialmanager/CredentialManagerClient.h"
93 #include "modules/encryptedmedia/MediaKeysController.h" 92 #include "modules/encryptedmedia/MediaKeysController.h"
94 #include "modules/storage/StorageNamespaceController.h" 93 #include "modules/storage/StorageNamespaceController.h"
(...skipping 3797 matching lines...) Expand 10 before | Expand all | Expand 10 after
3892 void WebViewImpl::setSelectionColors(unsigned activeBackgroundColor, 3891 void WebViewImpl::setSelectionColors(unsigned activeBackgroundColor,
3893 unsigned activeForegroundColor, 3892 unsigned activeForegroundColor,
3894 unsigned inactiveBackgroundColor, 3893 unsigned inactiveBackgroundColor,
3895 unsigned inactiveForegroundColor) { 3894 unsigned inactiveForegroundColor) {
3896 #if USE(DEFAULT_RENDER_THEME) 3895 #if USE(DEFAULT_RENDER_THEME)
3897 LayoutThemeDefault::setSelectionColors(activeBackgroundColor, activeForegrou ndColor, inactiveBackgroundColor, inactiveForegroundColor); 3896 LayoutThemeDefault::setSelectionColors(activeBackgroundColor, activeForegrou ndColor, inactiveBackgroundColor, inactiveForegroundColor);
3898 LayoutTheme::theme().platformColorsDidChange(); 3897 LayoutTheme::theme().platformColorsDidChange();
3899 #endif 3898 #endif
3900 } 3899 }
3901 3900
3902 void WebView::injectStyleSheet(const WebString& sourceCode, const WebVector<WebS tring>& patternsIn, WebView::StyleInjectionTarget injectIn)
3903 {
3904 Vector<String> patterns;
3905 for (size_t i = 0; i < patternsIn.size(); ++i)
3906 patterns.append(patternsIn[i]);
3907
3908 InjectedStyleSheets::instance().add(sourceCode, patterns, static_cast<blink: :StyleInjectionTarget>(injectIn));
3909 }
3910
3911 void WebView::removeInjectedStyleSheets()
3912 {
3913 InjectedStyleSheets::instance().removeAll();
3914 }
3915
3916 void WebViewImpl::didCommitLoad(bool isNewNavigation, bool isNavigationWithinPag e) 3901 void WebViewImpl::didCommitLoad(bool isNewNavigation, bool isNavigationWithinPag e)
3917 { 3902 {
3918 if (isNewNavigation && !isNavigationWithinPage) 3903 if (isNewNavigation && !isNavigationWithinPage)
3919 m_pageScaleConstraintsSet.setNeedsReset(true); 3904 m_pageScaleConstraintsSet.setNeedsReset(true);
3920 3905
3921 // Give the pinch viewport's scroll layer its initial size. 3906 // Give the pinch viewport's scroll layer its initial size.
3922 page()->frameHost().pinchViewport().mainFrameDidChangeSize(); 3907 page()->frameHost().pinchViewport().mainFrameDidChangeSize();
3923 3908
3924 // Make sure link highlight from previous page is cleared. 3909 // Make sure link highlight from previous page is cleared.
3925 m_linkHighlights.clear(); 3910 m_linkHighlights.clear();
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
4513 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4498 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4514 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4499 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4515 } 4500 }
4516 4501
4517 void WebViewImpl::forceNextWebGLContextCreationToFail() 4502 void WebViewImpl::forceNextWebGLContextCreationToFail()
4518 { 4503 {
4519 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); 4504 WebGLRenderingContext::forceNextWebGLContextCreationToFail();
4520 } 4505 }
4521 4506
4522 } // namespace blink 4507 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/AssertMatchingEnums.cpp ('k') | Source/web/tests/ViewportTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698