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/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/crash_logging.h" | 10 #include "base/debug/crash_logging.h" |
11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
12 #include "base/location.h" | 12 #include "base/location.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
15 #include "base/process/process.h" | 15 #include "base/process/process.h" |
16 #include "base/profiler/scoped_tracker.h" | 16 #include "base/profiler/scoped_tracker.h" |
17 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
18 #include "base/strings/string16.h" | 18 #include "base/strings/string16.h" |
19 #include "base/strings/string_number_conversions.h" | 19 #include "base/strings/string_number_conversions.h" |
20 #include "base/strings/string_util.h" | 20 #include "base/strings/string_util.h" |
21 #include "base/strings/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
22 #include "base/thread_task_runner_handle.h" | 22 #include "base/thread_task_runner_handle.h" |
23 #include "base/time/time.h" | 23 #include "base/time/time.h" |
24 #include "base/trace_event/trace_event.h" | 24 #include "base/trace_event/trace_event.h" |
25 #include "components/mime_util/mime_util.h" | 25 #include "components/mime_util/mime_util.h" |
| 26 #include "components/url_formatter/url_formatter.h" |
26 #include "content/browser/accessibility/accessibility_mode_helper.h" | 27 #include "content/browser/accessibility/accessibility_mode_helper.h" |
27 #include "content/browser/accessibility/browser_accessibility_state_impl.h" | 28 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
28 #include "content/browser/bad_message.h" | 29 #include "content/browser/bad_message.h" |
29 #include "content/browser/browser_plugin/browser_plugin_embedder.h" | 30 #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
30 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 31 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
31 #include "content/browser/child_process_security_policy_impl.h" | 32 #include "content/browser/child_process_security_policy_impl.h" |
32 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" | 33 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
33 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 34 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
34 #include "content/browser/download/download_stats.h" | 35 #include "content/browser/download/download_stats.h" |
35 #include "content/browser/download/mhtml_generation_manager.h" | 36 #include "content/browser/download/mhtml_generation_manager.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 #include "content/public/common/content_constants.h" | 96 #include "content/public/common/content_constants.h" |
96 #include "content/public/common/content_switches.h" | 97 #include "content/public/common/content_switches.h" |
97 #include "content/public/common/page_zoom.h" | 98 #include "content/public/common/page_zoom.h" |
98 #include "content/public/common/result_codes.h" | 99 #include "content/public/common/result_codes.h" |
99 #include "content/public/common/security_style.h" | 100 #include "content/public/common/security_style.h" |
100 #include "content/public/common/url_constants.h" | 101 #include "content/public/common/url_constants.h" |
101 #include "content/public/common/url_utils.h" | 102 #include "content/public/common/url_utils.h" |
102 #include "content/public/common/web_preferences.h" | 103 #include "content/public/common/web_preferences.h" |
103 #include "mojo/common/url_type_converters.h" | 104 #include "mojo/common/url_type_converters.h" |
104 #include "mojo/converters/geometry/geometry_type_converters.h" | 105 #include "mojo/converters/geometry/geometry_type_converters.h" |
105 #include "net/base/net_util.h" | |
106 #include "net/http/http_cache.h" | 106 #include "net/http/http_cache.h" |
107 #include "net/http/http_transaction_factory.h" | 107 #include "net/http/http_transaction_factory.h" |
108 #include "net/url_request/url_request_context.h" | 108 #include "net/url_request/url_request_context.h" |
109 #include "net/url_request/url_request_context_getter.h" | 109 #include "net/url_request/url_request_context_getter.h" |
110 #include "skia/public/type_converters.h" | 110 #include "skia/public/type_converters.h" |
111 #include "third_party/skia/include/core/SkBitmap.h" | 111 #include "third_party/skia/include/core/SkBitmap.h" |
112 #include "ui/base/layout.h" | 112 #include "ui/base/layout.h" |
113 #include "ui/gfx/display.h" | 113 #include "ui/gfx/display.h" |
114 #include "ui/gfx/screen.h" | 114 #include "ui/gfx/screen.h" |
115 #include "ui/gl/gl_switches.h" | 115 #include "ui/gl/gl_switches.h" |
(...skipping 4166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4282 uint64 upload_position, | 4282 uint64 upload_position, |
4283 uint64 upload_size) { | 4283 uint64 upload_size) { |
4284 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466285 | 4284 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466285 |
4285 // is fixed. | 4285 // is fixed. |
4286 tracked_objects::ScopedTracker tracking_profile1( | 4286 tracked_objects::ScopedTracker tracking_profile1( |
4287 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 4287 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
4288 "466285 WebContentsImpl::LoadStateChanged::Start")); | 4288 "466285 WebContentsImpl::LoadStateChanged::Start")); |
4289 load_state_ = load_state; | 4289 load_state_ = load_state; |
4290 upload_position_ = upload_position; | 4290 upload_position_ = upload_position; |
4291 upload_size_ = upload_size; | 4291 upload_size_ = upload_size; |
4292 load_state_host_ = net::IDNToUnicode(url.host(), | 4292 load_state_host_ = url_formatter::IDNToUnicode( |
4293 GetContentClient()->browser()->GetAcceptLangs( | 4293 url.host(), |
4294 GetBrowserContext())); | 4294 GetContentClient()->browser()->GetAcceptLangs(GetBrowserContext())); |
4295 if (load_state_.state == net::LOAD_STATE_READING_RESPONSE) | 4295 if (load_state_.state == net::LOAD_STATE_READING_RESPONSE) |
4296 SetNotWaitingForResponse(); | 4296 SetNotWaitingForResponse(); |
4297 if (IsLoading()) { | 4297 if (IsLoading()) { |
4298 NotifyNavigationStateChanged(static_cast<InvalidateTypes>( | 4298 NotifyNavigationStateChanged(static_cast<InvalidateTypes>( |
4299 INVALIDATE_TYPE_LOAD | INVALIDATE_TYPE_TAB)); | 4299 INVALIDATE_TYPE_LOAD | INVALIDATE_TYPE_TAB)); |
4300 } | 4300 } |
4301 } | 4301 } |
4302 | 4302 |
4303 void WebContentsImpl::BeforeUnloadFiredFromRenderManager( | 4303 void WebContentsImpl::BeforeUnloadFiredFromRenderManager( |
4304 bool proceed, const base::TimeTicks& proceed_time, | 4304 bool proceed, const base::TimeTicks& proceed_time, |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4647 player_map->erase(it); | 4647 player_map->erase(it); |
4648 } | 4648 } |
4649 | 4649 |
4650 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4650 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
4651 force_disable_overscroll_content_ = force_disable; | 4651 force_disable_overscroll_content_ = force_disable; |
4652 if (view_) | 4652 if (view_) |
4653 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4653 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
4654 } | 4654 } |
4655 | 4655 |
4656 } // namespace content | 4656 } // namespace content |
OLD | NEW |