OLD | NEW |
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 "chrome/browser/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 #include "chrome/browser/payments/payment_request_factory.h" | 256 #include "chrome/browser/payments/payment_request_factory.h" |
257 #endif | 257 #endif |
258 | 258 |
259 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 259 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
260 #include "base/debug/leak_annotations.h" | 260 #include "base/debug/leak_annotations.h" |
261 #include "components/crash/content/app/breakpad_linux.h" | 261 #include "components/crash/content/app/breakpad_linux.h" |
262 #include "components/crash/content/browser/crash_handler_host_linux.h" | 262 #include "components/crash/content/browser/crash_handler_host_linux.h" |
263 #endif | 263 #endif |
264 | 264 |
265 #if defined(OS_ANDROID) | 265 #if defined(OS_ANDROID) |
| 266 #include "chrome/browser/android/chrome_context_util.h" |
266 #include "chrome/browser/android/devtools_manager_delegate_android.h" | 267 #include "chrome/browser/android/devtools_manager_delegate_android.h" |
267 #include "chrome/browser/android/ntp/new_tab_page_url_handler.h" | 268 #include "chrome/browser/android/ntp/new_tab_page_url_handler.h" |
268 #include "chrome/browser/android/service_tab_launcher.h" | 269 #include "chrome/browser/android/service_tab_launcher.h" |
269 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" | 270 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" |
270 #include "components/payments/payment_request.mojom.h" | 271 #include "components/payments/payment_request.mojom.h" |
271 #include "content/public/browser/android/java_interfaces.h" | 272 #include "content/public/browser/android/java_interfaces.h" |
272 #include "ui/base/ui_base_paths.h" | 273 #include "ui/base/ui_base_paths.h" |
273 #include "ui/gfx/android/device_display_info.h" | |
274 #else | 274 #else |
275 #include "chrome/browser/devtools/chrome_devtools_manager_delegate.h" | 275 #include "chrome/browser/devtools/chrome_devtools_manager_delegate.h" |
276 #endif | 276 #endif |
277 | 277 |
278 #if defined(TOOLKIT_VIEWS) | 278 #if defined(TOOLKIT_VIEWS) |
279 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h" | 279 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h" |
280 #endif | 280 #endif |
281 | 281 |
282 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 282 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
283 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h" | 283 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h" |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 DISALLOW_COPY_AND_ASSIGN(CertificateReportingServiceCertReporter); | 697 DISALLOW_COPY_AND_ASSIGN(CertificateReportingServiceCertReporter); |
698 }; | 698 }; |
699 | 699 |
700 #if defined(OS_ANDROID) | 700 #if defined(OS_ANDROID) |
701 float GetDeviceScaleAdjustment() { | 701 float GetDeviceScaleAdjustment() { |
702 static const float kMinFSM = 1.05f; | 702 static const float kMinFSM = 1.05f; |
703 static const int kWidthForMinFSM = 320; | 703 static const int kWidthForMinFSM = 320; |
704 static const float kMaxFSM = 1.3f; | 704 static const float kMaxFSM = 1.3f; |
705 static const int kWidthForMaxFSM = 800; | 705 static const int kWidthForMaxFSM = 800; |
706 | 706 |
707 gfx::DeviceDisplayInfo info; | 707 int minWidth = chrome::android::ChromeContextUtil::GetSmallestDIPWidth(); |
708 int minWidth = info.GetSmallestDIPWidth(); | |
709 | 708 |
710 if (minWidth <= kWidthForMinFSM) | 709 if (minWidth <= kWidthForMinFSM) |
711 return kMinFSM; | 710 return kMinFSM; |
712 if (minWidth >= kWidthForMaxFSM) | 711 if (minWidth >= kWidthForMaxFSM) |
713 return kMaxFSM; | 712 return kMaxFSM; |
714 | 713 |
715 // The font scale multiplier varies linearly between kMinFSM and kMaxFSM. | 714 // The font scale multiplier varies linearly between kMinFSM and kMaxFSM. |
716 float ratio = static_cast<float>(minWidth - kWidthForMinFSM) / | 715 float ratio = static_cast<float>(minWidth - kWidthForMinFSM) / |
717 (kWidthForMaxFSM - kWidthForMinFSM); | 716 (kWidthForMaxFSM - kWidthForMinFSM); |
718 return ratio * (kMaxFSM - kMinFSM) + kMinFSM; | 717 return ratio * (kMaxFSM - kMinFSM) + kMinFSM; |
(...skipping 2627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3346 bool ChromeContentBrowserClient::ShouldRedirectDOMStorageTaskRunner() { | 3345 bool ChromeContentBrowserClient::ShouldRedirectDOMStorageTaskRunner() { |
3347 return variations::GetVariationParamValue( | 3346 return variations::GetVariationParamValue( |
3348 "BrowserScheduler", "RedirectDOMStorageTaskRunner") == "true"; | 3347 "BrowserScheduler", "RedirectDOMStorageTaskRunner") == "true"; |
3349 } | 3348 } |
3350 | 3349 |
3351 bool ChromeContentBrowserClient:: | 3350 bool ChromeContentBrowserClient:: |
3352 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { | 3351 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { |
3353 return variations::GetVariationParamValue( | 3352 return variations::GetVariationParamValue( |
3354 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; | 3353 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; |
3355 } | 3354 } |
OLD | NEW |