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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
132 #include "core/platform/NotImplemented.h" | 132 #include "core/platform/NotImplemented.h" |
133 #include "core/platform/PlatformGestureEvent.h" | 133 #include "core/platform/PlatformGestureEvent.h" |
134 #include "core/platform/PlatformKeyboardEvent.h" | 134 #include "core/platform/PlatformKeyboardEvent.h" |
135 #include "core/platform/PlatformMouseEvent.h" | 135 #include "core/platform/PlatformMouseEvent.h" |
136 #include "core/platform/PlatformWheelEvent.h" | 136 #include "core/platform/PlatformWheelEvent.h" |
137 #include "core/platform/PopupMenuClient.h" | 137 #include "core/platform/PopupMenuClient.h" |
138 #include "core/platform/Timer.h" | 138 #include "core/platform/Timer.h" |
139 #include "core/platform/chromium/KeyboardCodes.h" | 139 #include "core/platform/chromium/KeyboardCodes.h" |
140 #include "core/platform/chromium/TraceEvent.h" | 140 #include "core/platform/chromium/TraceEvent.h" |
141 #include "core/platform/chromium/support/WebActiveGestureAnimation.h" | 141 #include "core/platform/chromium/support/WebActiveGestureAnimation.h" |
142 #include "core/platform/graphics/Color.h" | |
143 #include "core/platform/graphics/ColorSpace.h" | 142 #include "core/platform/graphics/ColorSpace.h" |
144 #include "core/platform/graphics/Extensions3D.h" | 143 #include "core/platform/graphics/Extensions3D.h" |
145 #include "core/platform/graphics/FontCache.h" | 144 #include "core/platform/graphics/FontCache.h" |
146 #include "core/platform/graphics/FontDescription.h" | 145 #include "core/platform/graphics/FontDescription.h" |
147 #include "core/platform/graphics/GraphicsContext.h" | 146 #include "core/platform/graphics/GraphicsContext.h" |
148 #include "core/platform/graphics/GraphicsContext3D.h" | 147 #include "core/platform/graphics/GraphicsContext3D.h" |
149 #include "core/platform/graphics/Image.h" | 148 #include "core/platform/graphics/Image.h" |
150 #include "core/platform/graphics/ImageBuffer.h" | 149 #include "core/platform/graphics/ImageBuffer.h" |
151 #include "core/platform/graphics/chromium/LayerPainterChromium.h" | 150 #include "core/platform/graphics/chromium/LayerPainterChromium.h" |
152 #include "core/platform/graphics/gpu/SharedGraphicsContext3D.h" | 151 #include "core/platform/graphics/gpu/SharedGraphicsContext3D.h" |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
420 #if ENABLE(NAVIGATOR_CONTENT_UTILS) | 419 #if ENABLE(NAVIGATOR_CONTENT_UTILS) |
421 , m_navigatorContentUtilsClient(NavigatorContentUtilsClientImpl::create(this )) | 420 , m_navigatorContentUtilsClient(NavigatorContentUtilsClientImpl::create(this )) |
422 #endif | 421 #endif |
423 , m_flingModifier(0) | 422 , m_flingModifier(0) |
424 , m_flingSourceDevice(false) | 423 , m_flingSourceDevice(false) |
425 , m_showFPSCounter(false) | 424 , m_showFPSCounter(false) |
426 , m_showPaintRects(false) | 425 , m_showPaintRects(false) |
427 , m_showDebugBorders(false) | 426 , m_showDebugBorders(false) |
428 , m_continuousPaintingEnabled(false) | 427 , m_continuousPaintingEnabled(false) |
429 , m_showScrollBottleneckRects(false) | 428 , m_showScrollBottleneckRects(false) |
429 , m_baseBackgroundColor(Color::white) | |
430 { | 430 { |
431 Page::PageClients pageClients; | 431 Page::PageClients pageClients; |
432 pageClients.chromeClient = &m_chromeClientImpl; | 432 pageClients.chromeClient = &m_chromeClientImpl; |
433 pageClients.contextMenuClient = &m_contextMenuClientImpl; | 433 pageClients.contextMenuClient = &m_contextMenuClientImpl; |
434 pageClients.editorClient = &m_editorClientImpl; | 434 pageClients.editorClient = &m_editorClientImpl; |
435 pageClients.dragClient = &m_dragClientImpl; | 435 pageClients.dragClient = &m_dragClientImpl; |
436 pageClients.inspectorClient = &m_inspectorClientImpl; | 436 pageClients.inspectorClient = &m_inspectorClientImpl; |
437 pageClients.backForwardClient = &m_backForwardClientImpl; | 437 pageClients.backForwardClient = &m_backForwardClientImpl; |
438 | 438 |
439 m_page = adoptPtr(new Page(pageClients)); | 439 m_page = adoptPtr(new Page(pageClients)); |
(...skipping 2014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2454 if (!frame) | 2454 if (!frame) |
2455 return false; | 2455 return false; |
2456 return frame->selection()->isContentEditable(); | 2456 return frame->selection()->isContentEditable(); |
2457 } | 2457 } |
2458 | 2458 |
2459 WebColor WebViewImpl::backgroundColor() const | 2459 WebColor WebViewImpl::backgroundColor() const |
2460 { | 2460 { |
2461 if (isTransparent()) | 2461 if (isTransparent()) |
2462 return Color::transparent; | 2462 return Color::transparent; |
2463 if (!m_page) | 2463 if (!m_page) |
2464 return Color::white; | 2464 return m_baseBackgroundColor.rgb(); |
2465 FrameView* view = m_page->mainFrame()->view(); | 2465 FrameView* view = m_page->mainFrame()->view(); |
2466 StyleColor backgroundColor = view->documentBackgroundColor(); | 2466 StyleColor backgroundColor = view->documentBackgroundColor(); |
2467 if (!backgroundColor.isValid()) | 2467 if (!backgroundColor.isValid()) |
2468 return Color::white; | 2468 return m_baseBackgroundColor.rgb(); |
2469 return backgroundColor.rgb(); | 2469 return backgroundColor.rgb(); |
2470 } | 2470 } |
2471 | 2471 |
2472 bool WebViewImpl::caretOrSelectionRange(size_t* location, size_t* length) | 2472 bool WebViewImpl::caretOrSelectionRange(size_t* location, size_t* length) |
2473 { | 2473 { |
2474 const Frame* focused = focusedWebCoreFrame(); | 2474 const Frame* focused = focusedWebCoreFrame(); |
2475 if (!focused) | 2475 if (!focused) |
2476 return false; | 2476 return false; |
2477 | 2477 |
2478 FrameSelection* selection = focused->selection(); | 2478 FrameSelection* selection = focused->selection(); |
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3571 | 3571 |
3572 // Future frames check this to know whether to be transparent. | 3572 // Future frames check this to know whether to be transparent. |
3573 m_isTransparent = isTransparent; | 3573 m_isTransparent = isTransparent; |
3574 } | 3574 } |
3575 | 3575 |
3576 bool WebViewImpl::isTransparent() const | 3576 bool WebViewImpl::isTransparent() const |
3577 { | 3577 { |
3578 return m_isTransparent; | 3578 return m_isTransparent; |
3579 } | 3579 } |
3580 | 3580 |
3581 void WebViewImpl::setBaseBackgroundColor(WebColor color) | |
3582 { | |
3583 Color c(static_cast<RGBA32>(color)); | |
jamesr
2013/07/24 23:16:27
avoid one-letter variable names
WebColor and RGBA
| |
3584 if (m_baseBackgroundColor == c) | |
3585 return; | |
3586 | |
3587 m_baseBackgroundColor = c; | |
3588 | |
3589 m_page->mainFrame()->view()->updateBackgroundRecursively(c, m_isTransparent) ; | |
3590 | |
3591 if (m_layerTreeView) | |
3592 m_layerTreeView->setBackgroundColor(backgroundColor()); | |
3593 } | |
3594 | |
3581 void WebViewImpl::setIsActive(bool active) | 3595 void WebViewImpl::setIsActive(bool active) |
3582 { | 3596 { |
3583 if (page() && page()->focusController()) | 3597 if (page() && page()->focusController()) |
3584 page()->focusController()->setActive(active); | 3598 page()->focusController()->setActive(active); |
3585 } | 3599 } |
3586 | 3600 |
3587 bool WebViewImpl::isActive() const | 3601 bool WebViewImpl::isActive() const |
3588 { | 3602 { |
3589 return (page() && page()->focusController()) ? page()->focusController()->is Active() : false; | 3603 return (page() && page()->focusController()) ? page()->focusController()->is Active() : false; |
3590 } | 3604 } |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4144 } | 4158 } |
4145 | 4159 |
4146 bool WebViewImpl::shouldDisableDesktopWorkarounds() | 4160 bool WebViewImpl::shouldDisableDesktopWorkarounds() |
4147 { | 4161 { |
4148 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport Arguments(); | 4162 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport Arguments(); |
4149 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments. userZoom | 4163 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments. userZoom |
4150 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp ortArguments::ValueAuto); | 4164 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp ortArguments::ValueAuto); |
4151 } | 4165 } |
4152 | 4166 |
4153 } // namespace WebKit | 4167 } // namespace WebKit |
OLD | NEW |