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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 #include "content/public/browser/web_contents_observer.h" | 90 #include "content/public/browser/web_contents_observer.h" |
90 #include "content/public/common/bindings_policy.h" | 91 #include "content/public/common/bindings_policy.h" |
91 #include "content/public/common/content_constants.h" | 92 #include "content/public/common/content_constants.h" |
92 #include "content/public/common/content_switches.h" | 93 #include "content/public/common/content_switches.h" |
93 #include "content/public/common/page_zoom.h" | 94 #include "content/public/common/page_zoom.h" |
94 #include "content/public/common/result_codes.h" | 95 #include "content/public/common/result_codes.h" |
95 #include "content/public/common/security_style.h" | 96 #include "content/public/common/security_style.h" |
96 #include "content/public/common/url_constants.h" | 97 #include "content/public/common/url_constants.h" |
97 #include "content/public/common/url_utils.h" | 98 #include "content/public/common/url_utils.h" |
98 #include "content/public/common/web_preferences.h" | 99 #include "content/public/common/web_preferences.h" |
99 #include "net/base/net_util.h" | |
100 #include "net/http/http_cache.h" | 100 #include "net/http/http_cache.h" |
101 #include "net/http/http_transaction_factory.h" | 101 #include "net/http/http_transaction_factory.h" |
102 #include "net/url_request/url_request_context.h" | 102 #include "net/url_request/url_request_context.h" |
103 #include "net/url_request/url_request_context_getter.h" | 103 #include "net/url_request/url_request_context_getter.h" |
104 #include "ui/base/layout.h" | 104 #include "ui/base/layout.h" |
105 #include "ui/gfx/display.h" | 105 #include "ui/gfx/display.h" |
106 #include "ui/gfx/screen.h" | 106 #include "ui/gfx/screen.h" |
107 #include "ui/gl/gl_switches.h" | 107 #include "ui/gl/gl_switches.h" |
108 | 108 |
109 #if defined(ENABLE_BROWSER_CDMS) | 109 #if defined(ENABLE_BROWSER_CDMS) |
(...skipping 3947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4057 uint64 upload_position, | 4057 uint64 upload_position, |
4058 uint64 upload_size) { | 4058 uint64 upload_size) { |
4059 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466285 | 4059 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466285 |
4060 // is fixed. | 4060 // is fixed. |
4061 tracked_objects::ScopedTracker tracking_profile1( | 4061 tracked_objects::ScopedTracker tracking_profile1( |
4062 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 4062 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
4063 "466285 WebContentsImpl::LoadStateChanged::Start")); | 4063 "466285 WebContentsImpl::LoadStateChanged::Start")); |
4064 load_state_ = load_state; | 4064 load_state_ = load_state; |
4065 upload_position_ = upload_position; | 4065 upload_position_ = upload_position; |
4066 upload_size_ = upload_size; | 4066 upload_size_ = upload_size; |
4067 load_state_host_ = net::IDNToUnicode(url.host(), | 4067 load_state_host_ = url_formatter::IDNToUnicode( |
4068 GetContentClient()->browser()->GetAcceptLangs( | 4068 url.host(), |
4069 GetBrowserContext())); | 4069 GetContentClient()->browser()->GetAcceptLangs(GetBrowserContext())); |
4070 if (load_state_.state == net::LOAD_STATE_READING_RESPONSE) | 4070 if (load_state_.state == net::LOAD_STATE_READING_RESPONSE) |
4071 SetNotWaitingForResponse(); | 4071 SetNotWaitingForResponse(); |
4072 if (IsLoading()) { | 4072 if (IsLoading()) { |
4073 NotifyNavigationStateChanged(static_cast<InvalidateTypes>( | 4073 NotifyNavigationStateChanged(static_cast<InvalidateTypes>( |
4074 INVALIDATE_TYPE_LOAD | INVALIDATE_TYPE_TAB)); | 4074 INVALIDATE_TYPE_LOAD | INVALIDATE_TYPE_TAB)); |
4075 } | 4075 } |
4076 } | 4076 } |
4077 | 4077 |
4078 void WebContentsImpl::BeforeUnloadFiredFromRenderManager( | 4078 void WebContentsImpl::BeforeUnloadFiredFromRenderManager( |
4079 bool proceed, const base::TimeTicks& proceed_time, | 4079 bool proceed, const base::TimeTicks& proceed_time, |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4464 player_map->erase(it); | 4464 player_map->erase(it); |
4465 } | 4465 } |
4466 | 4466 |
4467 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4467 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
4468 force_disable_overscroll_content_ = force_disable; | 4468 force_disable_overscroll_content_ = force_disable; |
4469 if (view_) | 4469 if (view_) |
4470 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4470 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
4471 } | 4471 } |
4472 | 4472 |
4473 } // namespace content | 4473 } // namespace content |
OLD | NEW |