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 "chrome/browser/ui/tab_contents/core_tab_helper.h" | 5 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 } | 85 } |
86 | 86 |
87 // static | 87 // static |
88 bool CoreTabHelper::GetStatusTextForWebContents( | 88 bool CoreTabHelper::GetStatusTextForWebContents( |
89 base::string16* status_text, content::WebContents* source) { | 89 base::string16* status_text, content::WebContents* source) { |
90 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/467185 is | 90 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/467185 is |
91 // fixed. | 91 // fixed. |
92 tracked_objects::ScopedTracker tracking_profile1( | 92 tracked_objects::ScopedTracker tracking_profile1( |
93 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 93 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
94 "467185 CoreTabHelper::GetStatusTextForWebContents1")); | 94 "467185 CoreTabHelper::GetStatusTextForWebContents1")); |
95 auto guest_manager = | 95 auto guest_manager = extensions::GuestViewManager::FromBrowserContext( |
96 extensions::GuestViewManager::FromBrowserContextIfAvailable( | 96 source->GetBrowserContext()); |
97 source->GetBrowserContext()); | |
98 if (!source->IsLoading() || | 97 if (!source->IsLoading() || |
99 source->GetLoadState().state == net::LOAD_STATE_IDLE) { | 98 source->GetLoadState().state == net::LOAD_STATE_IDLE) { |
100 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/467185 | 99 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/467185 |
101 // is fixed. | 100 // is fixed. |
102 tracked_objects::ScopedTracker tracking_profile2( | 101 tracked_objects::ScopedTracker tracking_profile2( |
103 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 102 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
104 "467185 CoreTabHelper::GetStatusTextForWebContents2")); | 103 "467185 CoreTabHelper::GetStatusTextForWebContents2")); |
105 if (!guest_manager) | 104 if (!guest_manager) |
106 return false; | 105 return false; |
107 return guest_manager->ForEachGuest( | 106 return guest_manager->ForEachGuest( |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 DCHECK(!content_type.empty()); | 304 DCHECK(!content_type.empty()); |
306 open_url_params.uses_post = true; | 305 open_url_params.uses_post = true; |
307 open_url_params.browser_initiated_post_data = | 306 open_url_params.browser_initiated_post_data = |
308 base::RefCountedString::TakeString(post_data); | 307 base::RefCountedString::TakeString(post_data); |
309 open_url_params.extra_headers += base::StringPrintf( | 308 open_url_params.extra_headers += base::StringPrintf( |
310 "%s: %s\r\n", net::HttpRequestHeaders::kContentType, | 309 "%s: %s\r\n", net::HttpRequestHeaders::kContentType, |
311 content_type.c_str()); | 310 content_type.c_str()); |
312 } | 311 } |
313 web_contents()->OpenURL(open_url_params); | 312 web_contents()->OpenURL(open_url_params); |
314 } | 313 } |
OLD | NEW |