| 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 <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 void HandleSingleTabModeBlockOnUIThread(const BlockedWindowParams& params) { | 587 void HandleSingleTabModeBlockOnUIThread(const BlockedWindowParams& params) { |
| 588 WebContents* web_contents = | 588 WebContents* web_contents = |
| 589 tab_util::GetWebContentsByID(params.render_process_id(), | 589 tab_util::GetWebContentsByID(params.render_process_id(), |
| 590 params.opener_id()); | 590 params.opener_id()); |
| 591 if (!web_contents) | 591 if (!web_contents) |
| 592 return; | 592 return; |
| 593 | 593 |
| 594 SingleTabModeTabHelper::FromWebContents(web_contents)->HandleOpenUrl(params); | 594 SingleTabModeTabHelper::FromWebContents(web_contents)->HandleOpenUrl(params); |
| 595 } | 595 } |
| 596 | 596 |
| 597 float GetFontScaleMultiplier() { | 597 float GetDeviceScaleAdjustment() { |
| 598 static const float kMinFSM = 1.05f; | 598 static const float kMinFSM = 1.05f; |
| 599 static const int kWidthForMinFSM = 320; | 599 static const int kWidthForMinFSM = 320; |
| 600 static const float kMaxFSM = 1.3f; | 600 static const float kMaxFSM = 1.3f; |
| 601 static const int kWidthForMaxFSM = 800; | 601 static const int kWidthForMaxFSM = 800; |
| 602 | 602 |
| 603 gfx::DeviceDisplayInfo info; | 603 gfx::DeviceDisplayInfo info; |
| 604 int minWidth = info.GetSmallestDIPWidth(); | 604 int minWidth = info.GetSmallestDIPWidth(); |
| 605 | 605 |
| 606 if (minWidth <= kWidthForMinFSM) | 606 if (minWidth <= kWidthForMinFSM) |
| 607 return kMinFSM; | 607 return kMinFSM; |
| (...skipping 1604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2212 if (prefs->GetBoolean(prefs::kDisable3DAPIs)) | 2212 if (prefs->GetBoolean(prefs::kDisable3DAPIs)) |
| 2213 web_prefs->experimental_webgl_enabled = false; | 2213 web_prefs->experimental_webgl_enabled = false; |
| 2214 | 2214 |
| 2215 web_prefs->memory_info_enabled = | 2215 web_prefs->memory_info_enabled = |
| 2216 prefs->GetBoolean(prefs::kEnableMemoryInfo); | 2216 prefs->GetBoolean(prefs::kEnableMemoryInfo); |
| 2217 web_prefs->allow_displaying_insecure_content = | 2217 web_prefs->allow_displaying_insecure_content = |
| 2218 prefs->GetBoolean(prefs::kWebKitAllowDisplayingInsecureContent); | 2218 prefs->GetBoolean(prefs::kWebKitAllowDisplayingInsecureContent); |
| 2219 web_prefs->allow_running_insecure_content = | 2219 web_prefs->allow_running_insecure_content = |
| 2220 prefs->GetBoolean(prefs::kWebKitAllowRunningInsecureContent); | 2220 prefs->GetBoolean(prefs::kWebKitAllowRunningInsecureContent); |
| 2221 #if defined(OS_ANDROID) | 2221 #if defined(OS_ANDROID) |
| 2222 web_prefs->text_autosizing_font_scale_factor = | 2222 web_prefs->font_scale_factor = |
| 2223 static_cast<float>(prefs->GetDouble(prefs::kWebKitFontScaleFactor)) * | 2223 static_cast<float>(prefs->GetDouble(prefs::kWebKitFontScaleFactor)); |
| 2224 GetFontScaleMultiplier(); | 2224 web_prefs->device_scale_adjustment = GetDeviceScaleAdjustment(); |
| 2225 web_prefs->force_enable_zoom = | 2225 web_prefs->force_enable_zoom = |
| 2226 prefs->GetBoolean(prefs::kWebKitForceEnableZoom); | 2226 prefs->GetBoolean(prefs::kWebKitForceEnableZoom); |
| 2227 #endif | 2227 #endif |
| 2228 | 2228 |
| 2229 #if defined(OS_ANDROID) | 2229 #if defined(OS_ANDROID) |
| 2230 web_prefs->password_echo_enabled = | 2230 web_prefs->password_echo_enabled = |
| 2231 prefs->GetBoolean(prefs::kWebKitPasswordEchoEnabled); | 2231 prefs->GetBoolean(prefs::kWebKitPasswordEchoEnabled); |
| 2232 #else | 2232 #else |
| 2233 web_prefs->password_echo_enabled = browser_defaults::kPasswordEchoEnabled; | 2233 web_prefs->password_echo_enabled = browser_defaults::kPasswordEchoEnabled; |
| 2234 #endif | 2234 #endif |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2636 return IsExtensionOrSharedModuleWhitelisted(url, extension_set, | 2636 return IsExtensionOrSharedModuleWhitelisted(url, extension_set, |
| 2637 allowed_file_handle_origins_) || | 2637 allowed_file_handle_origins_) || |
| 2638 IsHostAllowedByCommandLine(url, extension_set, | 2638 IsHostAllowedByCommandLine(url, extension_set, |
| 2639 switches::kAllowNaClFileHandleAPI); | 2639 switches::kAllowNaClFileHandleAPI); |
| 2640 #else | 2640 #else |
| 2641 return false; | 2641 return false; |
| 2642 #endif | 2642 #endif |
| 2643 } | 2643 } |
| 2644 | 2644 |
| 2645 } // namespace chrome | 2645 } // namespace chrome |
| OLD | NEW |