OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tab_contents_wrapper.h" | 5 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/autocomplete_history_manager.h" | 10 #include "chrome/browser/autocomplete_history_manager.h" |
10 #include "chrome/browser/autofill/autofill_manager.h" | 11 #include "chrome/browser/autofill/autofill_manager.h" |
11 #include "chrome/browser/automation/automation_tab_helper.h" | 12 #include "chrome/browser/automation/automation_tab_helper.h" |
12 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/browser_shutdown.h" | 14 #include "chrome/browser/browser_shutdown.h" |
14 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 15 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
15 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 16 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
16 #include "chrome/browser/custom_handlers/register_protocol_handler_infobar_deleg
ate.h" | 17 #include "chrome/browser/custom_handlers/register_protocol_handler_infobar_deleg
ate.h" |
17 #include "chrome/browser/extensions/extension_tab_helper.h" | 18 #include "chrome/browser/extensions/extension_tab_helper.h" |
18 #include "chrome/browser/extensions/extension_webnavigation_api.h" | 19 #include "chrome/browser/extensions/extension_webnavigation_api.h" |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 "", | 301 "", |
301 PrefService::UNSYNCABLE_PREF); | 302 PrefService::UNSYNCABLE_PREF); |
302 } | 303 } |
303 | 304 |
304 string16 TabContentsWrapper::GetDefaultTitle() { | 305 string16 TabContentsWrapper::GetDefaultTitle() { |
305 return l10n_util::GetStringUTF16(IDS_DEFAULT_TAB_TITLE); | 306 return l10n_util::GetStringUTF16(IDS_DEFAULT_TAB_TITLE); |
306 } | 307 } |
307 | 308 |
308 string16 TabContentsWrapper::GetStatusText() const { | 309 string16 TabContentsWrapper::GetStatusText() const { |
309 if (!tab_contents()->IsLoading() || | 310 if (!tab_contents()->IsLoading() || |
310 tab_contents()->load_state() == net::LOAD_STATE_IDLE) { | 311 tab_contents()->load_state().state == net::LOAD_STATE_IDLE) { |
311 return string16(); | 312 return string16(); |
312 } | 313 } |
313 | 314 |
314 switch (tab_contents()->load_state()) { | 315 switch (tab_contents()->load_state().state) { |
| 316 case net::LOAD_STATE_WAITING_FOR_DELEGATE: |
| 317 return l10n_util::GetStringFUTF16(IDS_LOAD_STATE_WAITING_FOR_DELEGATE, |
| 318 tab_contents()->load_state().param); |
315 case net::LOAD_STATE_WAITING_FOR_CACHE: | 319 case net::LOAD_STATE_WAITING_FOR_CACHE: |
316 return l10n_util::GetStringUTF16(IDS_LOAD_STATE_WAITING_FOR_CACHE); | 320 return l10n_util::GetStringUTF16(IDS_LOAD_STATE_WAITING_FOR_CACHE); |
317 case net::LOAD_STATE_ESTABLISHING_PROXY_TUNNEL: | 321 case net::LOAD_STATE_ESTABLISHING_PROXY_TUNNEL: |
318 return | 322 return |
319 l10n_util::GetStringUTF16(IDS_LOAD_STATE_ESTABLISHING_PROXY_TUNNEL); | 323 l10n_util::GetStringUTF16(IDS_LOAD_STATE_ESTABLISHING_PROXY_TUNNEL); |
320 case net::LOAD_STATE_RESOLVING_PROXY_FOR_URL: | 324 case net::LOAD_STATE_RESOLVING_PROXY_FOR_URL: |
321 return l10n_util::GetStringUTF16(IDS_LOAD_STATE_RESOLVING_PROXY_FOR_URL); | 325 return l10n_util::GetStringUTF16(IDS_LOAD_STATE_RESOLVING_PROXY_FOR_URL); |
322 case net::LOAD_STATE_RESOLVING_HOST: | 326 case net::LOAD_STATE_RESOLVING_HOST: |
323 return l10n_util::GetStringUTF16(IDS_LOAD_STATE_RESOLVING_HOST); | 327 return l10n_util::GetStringUTF16(IDS_LOAD_STATE_RESOLVING_HOST); |
324 case net::LOAD_STATE_CONNECTING: | 328 case net::LOAD_STATE_CONNECTING: |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 if (infobars_.empty()) { | 718 if (infobars_.empty()) { |
715 registrar_.Remove(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, | 719 registrar_.Remove(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, |
716 Source<NavigationController>(&tab_contents_->controller())); | 720 Source<NavigationController>(&tab_contents_->controller())); |
717 } | 721 } |
718 } | 722 } |
719 | 723 |
720 void TabContentsWrapper::RemoveAllInfoBars(bool animate) { | 724 void TabContentsWrapper::RemoveAllInfoBars(bool animate) { |
721 while (!infobars_.empty()) | 725 while (!infobars_.empty()) |
722 RemoveInfoBarInternal(GetInfoBarDelegateAt(infobar_count() - 1), animate); | 726 RemoveInfoBarInternal(GetInfoBarDelegateAt(infobar_count() - 1), animate); |
723 } | 727 } |
OLD | NEW |