Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(656)

Side by Side Diff: chrome/browser/toolbar_model.cc

Issue 115346: Convert Punycode domains to Unicode in URLs shown in the followings:... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/toolbar_model.h" 5 #include "chrome/browser/toolbar_model.h"
6 6
7 #include "app/gfx/text_elider.h"
8 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
9 #include "chrome/browser/cert_store.h" 8 #include "chrome/browser/cert_store.h"
10 #include "chrome/browser/ssl/ssl_error_info.h" 9 #include "chrome/browser/ssl/ssl_error_info.h"
11 #include "chrome/browser/tab_contents/navigation_controller.h" 10 #include "chrome/browser/tab_contents/navigation_controller.h"
12 #include "chrome/browser/tab_contents/navigation_entry.h" 11 #include "chrome/browser/tab_contents/navigation_entry.h"
13 #include "chrome/browser/tab_contents/tab_contents.h" 12 #include "chrome/browser/tab_contents/tab_contents.h"
14 #include "chrome/common/pref_names.h" 13 #include "chrome/common/pref_names.h"
15 #include "chrome/common/pref_service.h" 14 #include "chrome/common/pref_service.h"
16 #include "grit/generated_resources.h" 15 #include "grit/generated_resources.h"
17 #include "net/base/net_util.h" 16 #include "net/base/net_util.h"
(...skipping 16 matching lines...) Expand all
34 prefs::kAcceptLanguages); 33 prefs::kAcceptLanguages);
35 NavigationEntry* entry = navigation_controller->GetActiveEntry(); 34 NavigationEntry* entry = navigation_controller->GetActiveEntry();
36 // We may not have a navigation entry yet 35 // We may not have a navigation entry yet
37 if (!navigation_controller->tab_contents()->ShouldDisplayURL()) { 36 if (!navigation_controller->tab_contents()->ShouldDisplayURL()) {
38 // Explicitly hide the URL for this tab. 37 // Explicitly hide the URL for this tab.
39 url = GURL(); 38 url = GURL();
40 } else if (entry) { 39 } else if (entry) {
41 url = entry->display_url(); 40 url = entry->display_url();
42 } 41 }
43 } 42 }
44 return gfx::GetCleanStringFromUrl(url, languages, NULL, NULL); 43 return net::FormatUrl(url, languages);
45 } 44 }
46 45
47 ToolbarModel::SecurityLevel ToolbarModel::GetSecurityLevel() { 46 ToolbarModel::SecurityLevel ToolbarModel::GetSecurityLevel() {
48 if (input_in_progress_) // When editing, assume no security style. 47 if (input_in_progress_) // When editing, assume no security style.
49 return ToolbarModel::NORMAL; 48 return ToolbarModel::NORMAL;
50 49
51 NavigationController* navigation_controller = GetNavigationController(); 50 NavigationController* navigation_controller = GetNavigationController();
52 if (!navigation_controller) // We might not have a controller on init. 51 if (!navigation_controller) // We might not have a controller on init.
53 return ToolbarModel::NORMAL; 52 return ToolbarModel::NORMAL;
54 53
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 // Multiple errors. 213 // Multiple errors.
215 text->assign(l10n_util::GetString(IDS_SEVERAL_SSL_ERRORS)); 214 text->assign(l10n_util::GetString(IDS_SEVERAL_SSL_ERRORS));
216 text->append(L"\n"); 215 text->append(L"\n");
217 for (int i = 0; i < error_count; ++i) { 216 for (int i = 0; i < error_count; ++i) {
218 text->append(errors[i].short_description()); 217 text->append(errors[i].short_description());
219 if (i != error_count - 1) 218 if (i != error_count - 1)
220 text->append(L"\n"); 219 text->append(L"\n");
221 } 220 }
222 } 221 }
223 } 222 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/navigation_entry.cc ('k') | chrome/browser/views/bookmark_editor_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698