OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/tab_contents/tab_contents.h" | 5 #include "chrome/browser/tab_contents/tab_contents.h" |
6 | 6 |
7 #if defined(OS_CHROMEOS) | 7 #if defined(OS_CHROMEOS) |
8 // For GdkScreen | 8 // For GdkScreen |
9 #include <gdk/gdk.h> | 9 #include <gdk/gdk.h> |
10 #endif // defined(OS_CHROMEOS) | 10 #endif // defined(OS_CHROMEOS) |
(...skipping 3144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3155 GURL::Replacements replacements; | 3155 GURL::Replacements replacements; |
3156 replacements.ClearUsername(); | 3156 replacements.ClearUsername(); |
3157 replacements.ClearPassword(); | 3157 replacements.ClearPassword(); |
3158 replacements.ClearPath(); | 3158 replacements.ClearPath(); |
3159 replacements.ClearQuery(); | 3159 replacements.ClearQuery(); |
3160 replacements.ClearRef(); | 3160 replacements.ClearRef(); |
3161 GURL clean_url = frame_url.ReplaceComponents(replacements); | 3161 GURL clean_url = frame_url.ReplaceComponents(replacements); |
3162 | 3162 |
3163 // TODO(brettw) it should be easier than this to do the correct language | 3163 // TODO(brettw) it should be easier than this to do the correct language |
3164 // handling without getting the accept language from the profile. | 3164 // handling without getting the accept language from the profile. |
3165 std::wstring base_address = gfx::ElideUrl(clean_url, gfx::Font(), 0, | 3165 string16 base_address = WideToUTF16(gfx::ElideUrl(clean_url, gfx::Font(), 0, |
3166 UTF8ToWide(profile()->GetPrefs()->GetString(prefs::kAcceptLanguages))); | 3166 UTF8ToWide(profile()->GetPrefs()->GetString(prefs::kAcceptLanguages)))); |
Evan Martin
2010/08/18 00:38:08
I think there's a GetStringUTF16 now
| |
3167 // Force URL to have LTR directionality. | 3167 // Force URL to have LTR directionality. |
3168 base::i18n::GetDisplayStringInLTRDirectionality(&base_address); | 3168 base_address = base::i18n::GetDisplayStringInLTRDirectionality(base_address); |
3169 | 3169 |
3170 return l10n_util::GetStringF( | 3170 return UTF16ToWide(l10n_util::GetStringFUTF16( |
3171 is_alert ? IDS_JAVASCRIPT_ALERT_TITLE : IDS_JAVASCRIPT_MESSAGEBOX_TITLE, | 3171 is_alert ? IDS_JAVASCRIPT_ALERT_TITLE : IDS_JAVASCRIPT_MESSAGEBOX_TITLE, |
3172 base_address); | 3172 base_address)); |
3173 } | 3173 } |
3174 | 3174 |
3175 gfx::NativeWindow TabContents::GetMessageBoxRootWindow() { | 3175 gfx::NativeWindow TabContents::GetMessageBoxRootWindow() { |
3176 return view_->GetTopLevelNativeWindow(); | 3176 return view_->GetTopLevelNativeWindow(); |
3177 } | 3177 } |
3178 | 3178 |
3179 void TabContents::OnMessageBoxClosed(IPC::Message* reply_msg, | 3179 void TabContents::OnMessageBoxClosed(IPC::Message* reply_msg, |
3180 bool success, | 3180 bool success, |
3181 const std::wstring& prompt) { | 3181 const std::wstring& prompt) { |
3182 last_javascript_message_dismissal_ = base::TimeTicks::Now(); | 3182 last_javascript_message_dismissal_ = base::TimeTicks::Now(); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3300 AddInfoBar(new SavePasswordInfoBarDelegate(this, form_to_save)); | 3300 AddInfoBar(new SavePasswordInfoBarDelegate(this, form_to_save)); |
3301 } | 3301 } |
3302 | 3302 |
3303 Profile* TabContents::GetProfileForPasswordManager() { | 3303 Profile* TabContents::GetProfileForPasswordManager() { |
3304 return profile(); | 3304 return profile(); |
3305 } | 3305 } |
3306 | 3306 |
3307 bool TabContents::DidLastPageLoadEncounterSSLErrors() { | 3307 bool TabContents::DidLastPageLoadEncounterSSLErrors() { |
3308 return controller().ssl_manager()->ProcessedSSLErrorFromRequest(); | 3308 return controller().ssl_manager()->ProcessedSSLErrorFromRequest(); |
3309 } | 3309 } |
OLD | NEW |