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/bind.h" | 10 #include "base/bind.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 } else { | 222 } else { |
223 *status_text = | 223 *status_text = |
224 l10n_util::GetStringUTF16(IDS_LOAD_STATE_SENDING_REQUEST); | 224 l10n_util::GetStringUTF16(IDS_LOAD_STATE_SENDING_REQUEST); |
225 return true; | 225 return true; |
226 } | 226 } |
227 case net::LOAD_STATE_WAITING_FOR_RESPONSE: | 227 case net::LOAD_STATE_WAITING_FOR_RESPONSE: |
228 *status_text = | 228 *status_text = |
229 l10n_util::GetStringFUTF16(IDS_LOAD_STATE_WAITING_FOR_RESPONSE, | 229 l10n_util::GetStringFUTF16(IDS_LOAD_STATE_WAITING_FOR_RESPONSE, |
230 source->GetLoadStateHost()); | 230 source->GetLoadStateHost()); |
231 return true; | 231 return true; |
| 232 case net::LOAD_STATE_THROTTLED: |
| 233 *status_text = l10n_util::GetStringUTF16(IDS_LOAD_STATE_THROTTLED); |
| 234 return true; |
232 // Ignore net::LOAD_STATE_READING_RESPONSE and net::LOAD_STATE_IDLE | 235 // Ignore net::LOAD_STATE_READING_RESPONSE and net::LOAD_STATE_IDLE |
233 case net::LOAD_STATE_IDLE: | 236 case net::LOAD_STATE_IDLE: |
234 case net::LOAD_STATE_READING_RESPONSE: | 237 case net::LOAD_STATE_READING_RESPONSE: |
235 break; | 238 break; |
236 } | 239 } |
237 if (!guest_manager) | 240 if (!guest_manager) |
238 return false; | 241 return false; |
239 | 242 |
240 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/467185 is | 243 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/467185 is |
241 // fixed. | 244 // fixed. |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 DCHECK(!content_type.empty()); | 392 DCHECK(!content_type.empty()); |
390 open_url_params.uses_post = true; | 393 open_url_params.uses_post = true; |
391 open_url_params.post_data = content::ResourceRequestBody::CreateFromBytes( | 394 open_url_params.post_data = content::ResourceRequestBody::CreateFromBytes( |
392 post_data.data(), post_data.size()); | 395 post_data.data(), post_data.size()); |
393 open_url_params.extra_headers += base::StringPrintf( | 396 open_url_params.extra_headers += base::StringPrintf( |
394 "%s: %s\r\n", net::HttpRequestHeaders::kContentType, | 397 "%s: %s\r\n", net::HttpRequestHeaders::kContentType, |
395 content_type.c_str()); | 398 content_type.c_str()); |
396 } | 399 } |
397 web_contents()->OpenURL(open_url_params); | 400 web_contents()->OpenURL(open_url_params); |
398 } | 401 } |
OLD | NEW |