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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 #include "content/public/common/content_constants.h" | 94 #include "content/public/common/content_constants.h" |
94 #include "content/public/common/content_switches.h" | 95 #include "content/public/common/content_switches.h" |
95 #include "content/public/common/page_zoom.h" | 96 #include "content/public/common/page_zoom.h" |
96 #include "content/public/common/result_codes.h" | 97 #include "content/public/common/result_codes.h" |
97 #include "content/public/common/security_style.h" | 98 #include "content/public/common/security_style.h" |
98 #include "content/public/common/url_constants.h" | 99 #include "content/public/common/url_constants.h" |
99 #include "content/public/common/url_utils.h" | 100 #include "content/public/common/url_utils.h" |
100 #include "content/public/common/web_preferences.h" | 101 #include "content/public/common/web_preferences.h" |
101 #include "mojo/common/url_type_converters.h" | 102 #include "mojo/common/url_type_converters.h" |
102 #include "mojo/converters/geometry/geometry_type_converters.h" | 103 #include "mojo/converters/geometry/geometry_type_converters.h" |
103 #include "net/base/net_util.h" | |
104 #include "net/http/http_cache.h" | 104 #include "net/http/http_cache.h" |
105 #include "net/http/http_transaction_factory.h" | 105 #include "net/http/http_transaction_factory.h" |
106 #include "net/url_request/url_request_context.h" | 106 #include "net/url_request/url_request_context.h" |
107 #include "net/url_request/url_request_context_getter.h" | 107 #include "net/url_request/url_request_context_getter.h" |
108 #include "skia/public/type_converters.h" | 108 #include "skia/public/type_converters.h" |
109 #include "third_party/skia/include/core/SkBitmap.h" | 109 #include "third_party/skia/include/core/SkBitmap.h" |
110 #include "ui/base/layout.h" | 110 #include "ui/base/layout.h" |
111 #include "ui/gfx/display.h" | 111 #include "ui/gfx/display.h" |
112 #include "ui/gfx/screen.h" | 112 #include "ui/gfx/screen.h" |
113 #include "ui/gl/gl_switches.h" | 113 #include "ui/gl/gl_switches.h" |
(...skipping 4079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4193 uint64 upload_position, | 4193 uint64 upload_position, |
4194 uint64 upload_size) { | 4194 uint64 upload_size) { |
4195 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466285 | 4195 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466285 |
4196 // is fixed. | 4196 // is fixed. |
4197 tracked_objects::ScopedTracker tracking_profile1( | 4197 tracked_objects::ScopedTracker tracking_profile1( |
4198 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 4198 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
4199 "466285 WebContentsImpl::LoadStateChanged::Start")); | 4199 "466285 WebContentsImpl::LoadStateChanged::Start")); |
4200 load_state_ = load_state; | 4200 load_state_ = load_state; |
4201 upload_position_ = upload_position; | 4201 upload_position_ = upload_position; |
4202 upload_size_ = upload_size; | 4202 upload_size_ = upload_size; |
4203 load_state_host_ = net::IDNToUnicode(url.host(), | 4203 load_state_host_ = url_formatter::IDNToUnicode( |
4204 GetContentClient()->browser()->GetAcceptLangs( | 4204 url.host(), |
4205 GetBrowserContext())); | 4205 GetContentClient()->browser()->GetAcceptLangs(GetBrowserContext())); |
4206 if (load_state_.state == net::LOAD_STATE_READING_RESPONSE) | 4206 if (load_state_.state == net::LOAD_STATE_READING_RESPONSE) |
4207 SetNotWaitingForResponse(); | 4207 SetNotWaitingForResponse(); |
4208 if (IsLoading()) { | 4208 if (IsLoading()) { |
4209 NotifyNavigationStateChanged(static_cast<InvalidateTypes>( | 4209 NotifyNavigationStateChanged(static_cast<InvalidateTypes>( |
4210 INVALIDATE_TYPE_LOAD | INVALIDATE_TYPE_TAB)); | 4210 INVALIDATE_TYPE_LOAD | INVALIDATE_TYPE_TAB)); |
4211 } | 4211 } |
4212 } | 4212 } |
4213 | 4213 |
4214 void WebContentsImpl::BeforeUnloadFiredFromRenderManager( | 4214 void WebContentsImpl::BeforeUnloadFiredFromRenderManager( |
4215 bool proceed, const base::TimeTicks& proceed_time, | 4215 bool proceed, const base::TimeTicks& proceed_time, |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4558 player_map->erase(it); | 4558 player_map->erase(it); |
4559 } | 4559 } |
4560 | 4560 |
4561 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4561 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
4562 force_disable_overscroll_content_ = force_disable; | 4562 force_disable_overscroll_content_ = force_disable; |
4563 if (view_) | 4563 if (view_) |
4564 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4564 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
4565 } | 4565 } |
4566 | 4566 |
4567 } // namespace content | 4567 } // namespace content |
OLD | NEW |