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/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/process/process.h" | 14 #include "base/process/process.h" |
15 #include "base/profiler/scoped_tracker.h" | 15 #include "base/profiler/scoped_tracker.h" |
16 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
17 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
18 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
19 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
20 #include "base/strings/utf_string_conversions.h" | 20 #include "base/strings/utf_string_conversions.h" |
21 #include "base/thread_task_runner_handle.h" | 21 #include "base/thread_task_runner_handle.h" |
22 #include "base/time/time.h" | 22 #include "base/time/time.h" |
23 #include "base/trace_event/trace_event.h" | 23 #include "base/trace_event/trace_event.h" |
24 #include "components/mime_util/mime_util.h" | 24 #include "components/mime_util/mime_util.h" |
| 25 #include "components/url_formatter/url_formatter.h" |
25 #include "content/browser/accessibility/accessibility_mode_helper.h" | 26 #include "content/browser/accessibility/accessibility_mode_helper.h" |
26 #include "content/browser/accessibility/browser_accessibility_state_impl.h" | 27 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
27 #include "content/browser/bad_message.h" | 28 #include "content/browser/bad_message.h" |
28 #include "content/browser/browser_plugin/browser_plugin_embedder.h" | 29 #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
29 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 30 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
30 #include "content/browser/child_process_security_policy_impl.h" | 31 #include "content/browser/child_process_security_policy_impl.h" |
31 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" | 32 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
32 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 33 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
33 #include "content/browser/download/download_stats.h" | 34 #include "content/browser/download/download_stats.h" |
34 #include "content/browser/download/mhtml_generation_manager.h" | 35 #include "content/browser/download/mhtml_generation_manager.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 #include "content/public/common/content_constants.h" | 95 #include "content/public/common/content_constants.h" |
95 #include "content/public/common/content_switches.h" | 96 #include "content/public/common/content_switches.h" |
96 #include "content/public/common/page_zoom.h" | 97 #include "content/public/common/page_zoom.h" |
97 #include "content/public/common/result_codes.h" | 98 #include "content/public/common/result_codes.h" |
98 #include "content/public/common/security_style.h" | 99 #include "content/public/common/security_style.h" |
99 #include "content/public/common/url_constants.h" | 100 #include "content/public/common/url_constants.h" |
100 #include "content/public/common/url_utils.h" | 101 #include "content/public/common/url_utils.h" |
101 #include "content/public/common/web_preferences.h" | 102 #include "content/public/common/web_preferences.h" |
102 #include "mojo/common/url_type_converters.h" | 103 #include "mojo/common/url_type_converters.h" |
103 #include "mojo/converters/geometry/geometry_type_converters.h" | 104 #include "mojo/converters/geometry/geometry_type_converters.h" |
104 #include "net/base/net_util.h" | |
105 #include "net/http/http_cache.h" | 105 #include "net/http/http_cache.h" |
106 #include "net/http/http_transaction_factory.h" | 106 #include "net/http/http_transaction_factory.h" |
107 #include "net/url_request/url_request_context.h" | 107 #include "net/url_request/url_request_context.h" |
108 #include "net/url_request/url_request_context_getter.h" | 108 #include "net/url_request/url_request_context_getter.h" |
109 #include "skia/public/type_converters.h" | 109 #include "skia/public/type_converters.h" |
110 #include "third_party/skia/include/core/SkBitmap.h" | 110 #include "third_party/skia/include/core/SkBitmap.h" |
111 #include "ui/base/layout.h" | 111 #include "ui/base/layout.h" |
112 #include "ui/gfx/display.h" | 112 #include "ui/gfx/display.h" |
113 #include "ui/gfx/screen.h" | 113 #include "ui/gfx/screen.h" |
114 #include "ui/gl/gl_switches.h" | 114 #include "ui/gl/gl_switches.h" |
(...skipping 4128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4243 uint64 upload_position, | 4243 uint64 upload_position, |
4244 uint64 upload_size) { | 4244 uint64 upload_size) { |
4245 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466285 | 4245 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466285 |
4246 // is fixed. | 4246 // is fixed. |
4247 tracked_objects::ScopedTracker tracking_profile1( | 4247 tracked_objects::ScopedTracker tracking_profile1( |
4248 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 4248 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
4249 "466285 WebContentsImpl::LoadStateChanged::Start")); | 4249 "466285 WebContentsImpl::LoadStateChanged::Start")); |
4250 load_state_ = load_state; | 4250 load_state_ = load_state; |
4251 upload_position_ = upload_position; | 4251 upload_position_ = upload_position; |
4252 upload_size_ = upload_size; | 4252 upload_size_ = upload_size; |
4253 load_state_host_ = net::IDNToUnicode(url.host(), | 4253 load_state_host_ = url_formatter::IDNToUnicode( |
4254 GetContentClient()->browser()->GetAcceptLangs( | 4254 url.host(), |
4255 GetBrowserContext())); | 4255 GetContentClient()->browser()->GetAcceptLangs(GetBrowserContext())); |
4256 if (load_state_.state == net::LOAD_STATE_READING_RESPONSE) | 4256 if (load_state_.state == net::LOAD_STATE_READING_RESPONSE) |
4257 SetNotWaitingForResponse(); | 4257 SetNotWaitingForResponse(); |
4258 if (IsLoading()) { | 4258 if (IsLoading()) { |
4259 NotifyNavigationStateChanged(static_cast<InvalidateTypes>( | 4259 NotifyNavigationStateChanged(static_cast<InvalidateTypes>( |
4260 INVALIDATE_TYPE_LOAD | INVALIDATE_TYPE_TAB)); | 4260 INVALIDATE_TYPE_LOAD | INVALIDATE_TYPE_TAB)); |
4261 } | 4261 } |
4262 } | 4262 } |
4263 | 4263 |
4264 void WebContentsImpl::BeforeUnloadFiredFromRenderManager( | 4264 void WebContentsImpl::BeforeUnloadFiredFromRenderManager( |
4265 bool proceed, const base::TimeTicks& proceed_time, | 4265 bool proceed, const base::TimeTicks& proceed_time, |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4608 player_map->erase(it); | 4608 player_map->erase(it); |
4609 } | 4609 } |
4610 | 4610 |
4611 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4611 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
4612 force_disable_overscroll_content_ = force_disable; | 4612 force_disable_overscroll_content_ = force_disable; |
4613 if (view_) | 4613 if (view_) |
4614 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4614 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
4615 } | 4615 } |
4616 | 4616 |
4617 } // namespace content | 4617 } // namespace content |
OLD | NEW |