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/toolbar_model.h" | 5 #include "chrome/browser/toolbar_model.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "chrome/browser/browser.h" | 8 #include "chrome/browser/browser.h" |
9 #include "chrome/browser/cert_store.h" | 9 #include "chrome/browser/cert_store.h" |
10 #include "chrome/browser/pref_service.h" | 10 #include "chrome/browser/pref_service.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 url = entry->virtual_url(); | 46 url = entry->virtual_url(); |
47 } | 47 } |
48 } | 48 } |
49 if (url.spec().length() > chrome::kMaxURLDisplayChars) { | 49 if (url.spec().length() > chrome::kMaxURLDisplayChars) { |
50 if (url.IsStandard()) { | 50 if (url.IsStandard()) { |
51 url = url.GetOrigin(); | 51 url = url.GetOrigin(); |
52 } else { | 52 } else { |
53 url = GURL(url.scheme() + ":"); | 53 url = GURL(url.scheme() + ":"); |
54 } | 54 } |
55 } | 55 } |
56 return net::FormatUrl(url, languages, true, UnescapeRule::NORMAL, NULL, NULL, | 56 return net::FormatUrl(url, languages, net::kFormatUrlOmitAll, |
57 NULL); | 57 UnescapeRule::NORMAL, NULL, NULL, NULL); |
58 } | 58 } |
59 | 59 |
60 ToolbarModel::SecurityLevel ToolbarModel::GetSecurityLevel() const { | 60 ToolbarModel::SecurityLevel ToolbarModel::GetSecurityLevel() const { |
61 if (input_in_progress_) // When editing, assume no security style. | 61 if (input_in_progress_) // When editing, assume no security style. |
62 return NONE; | 62 return NONE; |
63 | 63 |
64 NavigationController* navigation_controller = GetNavigationController(); | 64 NavigationController* navigation_controller = GetNavigationController(); |
65 if (!navigation_controller) // We might not have a controller on init. | 65 if (!navigation_controller) // We might not have a controller on init. |
66 return NONE; | 66 return NONE; |
67 | 67 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 *text = errors[0].short_description(); | 197 *text = errors[0].short_description(); |
198 } else { | 198 } else { |
199 // Multiple errors. | 199 // Multiple errors. |
200 *text = l10n_util::GetString(IDS_SEVERAL_SSL_ERRORS); | 200 *text = l10n_util::GetString(IDS_SEVERAL_SSL_ERRORS); |
201 for (size_t i = 0; i < errors.size(); ++i) { | 201 for (size_t i = 0; i < errors.size(); ++i) { |
202 text->append(L"\n"); | 202 text->append(L"\n"); |
203 text->append(errors[i].short_description()); | 203 text->append(errors[i].short_description()); |
204 } | 204 } |
205 } | 205 } |
206 } | 206 } |
OLD | NEW |