OLD | NEW |
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 3574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3585 void WebViewImpl::setSelectionColors(unsigned activeBackgroundColor, | 3585 void WebViewImpl::setSelectionColors(unsigned activeBackgroundColor, |
3586 unsigned activeForegroundColor, | 3586 unsigned activeForegroundColor, |
3587 unsigned inactiveBackgroundColor, | 3587 unsigned inactiveBackgroundColor, |
3588 unsigned inactiveForegroundColor) { | 3588 unsigned inactiveForegroundColor) { |
3589 #if ENABLE(DEFAULT_RENDER_THEME) | 3589 #if ENABLE(DEFAULT_RENDER_THEME) |
3590 RenderThemeChromiumDefault::setSelectionColors(activeBackgroundColor, active
ForegroundColor, inactiveBackgroundColor, inactiveForegroundColor); | 3590 RenderThemeChromiumDefault::setSelectionColors(activeBackgroundColor, active
ForegroundColor, inactiveBackgroundColor, inactiveForegroundColor); |
3591 theme()->platformColorsDidChange(); | 3591 theme()->platformColorsDidChange(); |
3592 #endif | 3592 #endif |
3593 } | 3593 } |
3594 | 3594 |
3595 void WebView::addUserScript(const WebString& sourceCode, | |
3596 const WebVector<WebString>& patternsIn, | |
3597 WebView::UserScriptInjectAt injectAt, | |
3598 WebView::UserContentInjectIn injectIn) | |
3599 { | |
3600 Vector<String> patterns; | |
3601 for (size_t i = 0; i < patternsIn.size(); ++i) | |
3602 patterns.append(patternsIn[i]); | |
3603 | |
3604 PageGroup* pageGroup = PageGroup::pageGroup(pageGroupName); | |
3605 RefPtr<DOMWrapperWorld> world(DOMWrapperWorld::createUninitializedWorld()); | |
3606 pageGroup->addUserScriptToWorld(world.get(), sourceCode, WebURL(), patterns,
Vector<String>(), | |
3607 static_cast<UserScriptInjectionTime>(injectA
t), | |
3608 static_cast<UserContentInjectedFrames>(injec
tIn)); | |
3609 } | |
3610 | |
3611 void WebView::addUserStyleSheet(const WebString& sourceCode, | 3595 void WebView::addUserStyleSheet(const WebString& sourceCode, |
3612 const WebVector<WebString>& patternsIn, | 3596 const WebVector<WebString>& patternsIn, |
3613 WebView::UserContentInjectIn injectIn, | 3597 WebView::UserContentInjectIn injectIn, |
3614 WebView::UserStyleInjectionTime injectionTime) | 3598 WebView::UserStyleInjectionTime injectionTime) |
3615 { | 3599 { |
3616 Vector<String> patterns; | 3600 Vector<String> patterns; |
3617 for (size_t i = 0; i < patternsIn.size(); ++i) | 3601 for (size_t i = 0; i < patternsIn.size(); ++i) |
3618 patterns.append(patternsIn[i]); | 3602 patterns.append(patternsIn[i]); |
3619 | 3603 |
3620 PageGroup* pageGroup = PageGroup::pageGroup(pageGroupName); | 3604 PageGroup* pageGroup = PageGroup::pageGroup(pageGroupName); |
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4209 } | 4193 } |
4210 | 4194 |
4211 bool WebViewImpl::shouldDisableDesktopWorkarounds() | 4195 bool WebViewImpl::shouldDisableDesktopWorkarounds() |
4212 { | 4196 { |
4213 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport
Arguments(); | 4197 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport
Arguments(); |
4214 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments.
userZoom | 4198 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments.
userZoom |
4215 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp
ortArguments::ValueAuto); | 4199 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp
ortArguments::ValueAuto); |
4216 } | 4200 } |
4217 | 4201 |
4218 } // namespace WebKit | 4202 } // namespace WebKit |
OLD | NEW |