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

Side by Side Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 10544168: Implement HiDPI support in Pepper dev interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comments to Graphics2DDev C++ header Created 8 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" 5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/linked_ptr.h" 10 #include "base/memory/linked_ptr.h"
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 // in the "everything is clipped" case. 743 // in the "everything is clipped" case.
744 gfx::Rect new_clip; 744 gfx::Rect new_clip;
745 if (!clip.IsEmpty()) 745 if (!clip.IsEmpty())
746 new_clip = clip; 746 new_clip = clip;
747 747
748 ViewData previous_view = view_data_; 748 ViewData previous_view = view_data_;
749 749
750 view_data_.rect = PP_FromGfxRect(position); 750 view_data_.rect = PP_FromGfxRect(position);
751 view_data_.clip_rect = PP_FromGfxRect(clip); 751 view_data_.clip_rect = PP_FromGfxRect(clip);
752 752
753 #if WEBPLUGINCONTAINER_HAS_GETDEVICESCALEFACTOR
754 view_data_.device_scale = container_->getDeviceScaleFactor();
755 #else
756 view_data_.device_scale = 1.0f;
757 #endif // WEBPLUGINCONTAINER_HAS_GETDEVICESCALEFACTOR
758
759 #if WEBPLUGINCONTAINER_HAS_GETPAGEZOOMFACTOR
760 view_data_.css_scale = container_->getPageZoomFactor();
761 #else
762 view_data_.css_scale = 1.0f;
763 #endif // WEBPLUGINCONTAINER_HAS_GETPAGEZOOMFACTOR
764
753 if (desired_fullscreen_state_ || view_data_.is_fullscreen) { 765 if (desired_fullscreen_state_ || view_data_.is_fullscreen) {
754 WebElement element = container_->element(); 766 WebElement element = container_->element();
755 WebDocument document = element.document(); 767 WebDocument document = element.document();
756 bool is_fullscreen_element = (element == document.fullScreenElement()); 768 bool is_fullscreen_element = (element == document.fullScreenElement());
757 if (!view_data_.is_fullscreen && desired_fullscreen_state_ && 769 if (!view_data_.is_fullscreen && desired_fullscreen_state_ &&
758 delegate()->IsInFullscreenMode() && is_fullscreen_element) { 770 delegate()->IsInFullscreenMode() && is_fullscreen_element) {
759 // Entered fullscreen. Only possible via SetFullscreen(). 771 // Entered fullscreen. Only possible via SetFullscreen().
760 view_data_.is_fullscreen = true; 772 view_data_.is_fullscreen = true;
761 } else if (view_data_.is_fullscreen && !is_fullscreen_element) { 773 } else if (view_data_.is_fullscreen && !is_fullscreen_element) {
762 // Exited fullscreen. Possible via SetFullscreen() or F11/link, 774 // Exited fullscreen. Possible via SetFullscreen() or F11/link,
(...skipping 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after
2152 screen_size_for_fullscreen_ = gfx::Size(); 2164 screen_size_for_fullscreen_ = gfx::Size();
2153 WebElement element = container_->element(); 2165 WebElement element = container_->element();
2154 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); 2166 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_);
2155 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); 2167 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_);
2156 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); 2168 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_);
2157 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); 2169 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_);
2158 } 2170 }
2159 2171
2160 } // namespace ppapi 2172 } // namespace ppapi
2161 } // namespace webkit 2173 } // namespace webkit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698