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 "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/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 LAZY_INSTANCE_INITIALIZER; | 356 LAZY_INSTANCE_INITIALIZER; |
357 | 357 |
358 // Time, in seconds, we delay before sending content state changes (such as form | 358 // Time, in seconds, we delay before sending content state changes (such as form |
359 // state and scroll position) to the browser. We delay sending changes to avoid | 359 // state and scroll position) to the browser. We delay sending changes to avoid |
360 // spamming the browser. | 360 // spamming the browser. |
361 // To avoid having tab/session restore require sending a message to get the | 361 // To avoid having tab/session restore require sending a message to get the |
362 // current content state during tab closing we use a shorter timeout for the | 362 // current content state during tab closing we use a shorter timeout for the |
363 // foreground renderer. This means there is a small window of time from which | 363 // foreground renderer. This means there is a small window of time from which |
364 // content state is modified and not sent to session restore, but this is | 364 // content state is modified and not sent to session restore, but this is |
365 // better than having to wake up all renderers during shutdown. | 365 // better than having to wake up all renderers during shutdown. |
366 static const int kDelaySecondsForContentStateSyncHidden = 5; | 366 const int kDelaySecondsForContentStateSyncHidden = 5; |
367 static const int kDelaySecondsForContentStateSync = 1; | 367 const int kDelaySecondsForContentStateSync = 1; |
368 | 368 |
369 static const size_t kExtraCharsBeforeAndAfterSelection = 100; | 369 const size_t kExtraCharsBeforeAndAfterSelection = 100; |
370 | 370 |
371 static const float kScalingIncrement = 0.1f; | 371 const float kScalingIncrementForGesture = 0.01f; |
372 | |
373 static const float kScalingIncrementForGesture = 0.01f; | |
374 | 372 |
375 #if defined(OS_ANDROID) | 373 #if defined(OS_ANDROID) |
376 // Delay between tapping in content and launching the associated android intent. | 374 // Delay between tapping in content and launching the associated android intent. |
377 // Used to allow users see what has been recognized as content. | 375 // Used to allow users see what has been recognized as content. |
378 static const size_t kContentIntentDelayMilliseconds = 700; | 376 const size_t kContentIntentDelayMilliseconds = 700; |
379 #endif | 377 #endif |
380 | 378 |
381 static RenderViewImpl* (*g_create_render_view_impl)(RenderViewImplParams*) = | 379 static RenderViewImpl* (*g_create_render_view_impl)(RenderViewImplParams*) = |
382 NULL; | 380 NULL; |
383 | 381 |
384 static void GetRedirectChain(WebDataSource* ds, std::vector<GURL>* result) { | 382 static void GetRedirectChain(WebDataSource* ds, std::vector<GURL>* result) { |
385 // Replace any occurrences of swappedout:// with about:blank. | 383 // Replace any occurrences of swappedout:// with about:blank. |
386 const WebURL& blank_url = GURL(kAboutBlankURL); | 384 const WebURL& blank_url = GURL(kAboutBlankURL); |
387 WebVector<WebURL> urls; | 385 WebVector<WebURL> urls; |
388 ds->redirectChain(urls); | 386 ds->redirectChain(urls); |
(...skipping 6117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6506 for (size_t i = 0; i < icon_urls.size(); i++) { | 6504 for (size_t i = 0; i < icon_urls.size(); i++) { |
6507 WebURL url = icon_urls[i].iconURL(); | 6505 WebURL url = icon_urls[i].iconURL(); |
6508 if (!url.isEmpty()) | 6506 if (!url.isEmpty()) |
6509 urls.push_back(FaviconURL(url, | 6507 urls.push_back(FaviconURL(url, |
6510 ToFaviconType(icon_urls[i].iconType()))); | 6508 ToFaviconType(icon_urls[i].iconType()))); |
6511 } | 6509 } |
6512 SendUpdateFaviconURL(urls); | 6510 SendUpdateFaviconURL(urls); |
6513 } | 6511 } |
6514 | 6512 |
6515 } // namespace content | 6513 } // namespace content |
OLD | NEW |