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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 11348033: Initialize device scale factor correctly on Android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved scale factor logic to gfx::Display Created 8 years, 1 month 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 "content/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 #endif 621 #endif
622 622
623 webwidget_ = WebView::create(this); 623 webwidget_ = WebView::create(this);
624 webwidget_mouse_lock_target_.reset(new WebWidgetLockTarget(webwidget_)); 624 webwidget_mouse_lock_target_.reset(new WebWidgetLockTarget(webwidget_));
625 625
626 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 626 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
627 627
628 #if defined(OS_ANDROID) 628 #if defined(OS_ANDROID)
629 scoped_ptr<DeviceInfo> device_info(new DeviceInfo()); 629 scoped_ptr<DeviceInfo> device_info(new DeviceInfo());
630 630
631 webview()->setDeviceScaleFactor(device_info->GetDPIScale());
632
633 const std::string region_code = 631 const std::string region_code =
634 command_line.HasSwitch(switches::kNetworkCountryIso) 632 command_line.HasSwitch(switches::kNetworkCountryIso)
635 ? command_line.GetSwitchValueASCII(switches::kNetworkCountryIso) 633 ? command_line.GetSwitchValueASCII(switches::kNetworkCountryIso)
636 : device_info->GetNetworkCountryIso(); 634 : device_info->GetNetworkCountryIso();
637 content_detectors_.push_back(linked_ptr<ContentDetector>( 635 content_detectors_.push_back(linked_ptr<ContentDetector>(
638 new AddressDetector())); 636 new AddressDetector()));
639 content_detectors_.push_back(linked_ptr<ContentDetector>( 637 content_detectors_.push_back(linked_ptr<ContentDetector>(
640 new PhoneNumberDetector(region_code))); 638 new PhoneNumberDetector(region_code)));
641 content_detectors_.push_back(linked_ptr<ContentDetector>( 639 content_detectors_.push_back(linked_ptr<ContentDetector>(
642 new EmailDetector())); 640 new EmailDetector()));
(...skipping 5700 matching lines...) Expand 10 before | Expand all | Expand 10 after
6343 } 6341 }
6344 #endif 6342 #endif
6345 6343
6346 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( 6344 void RenderViewImpl::OnReleaseDisambiguationPopupDIB(
6347 TransportDIB::Handle dib_handle) { 6345 TransportDIB::Handle dib_handle) {
6348 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); 6346 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle);
6349 RenderProcess::current()->ReleaseTransportDIB(dib); 6347 RenderProcess::current()->ReleaseTransportDIB(dib);
6350 } 6348 }
6351 6349
6352 } // namespace content 6350 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698