| OLD | NEW |
| 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/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "chrome/browser/cert_store.h" | 8 #include "chrome/browser/cert_store.h" |
| 9 #include "chrome/browser/profile.h" | 9 #include "chrome/browser/profile.h" |
| 10 #include "chrome/browser/ssl/ssl_error_info.h" | 10 #include "chrome/browser/ssl/ssl_error_info.h" |
| 11 #include "chrome/browser/tab_contents/navigation_controller.h" | 11 #include "chrome/browser/tab_contents/navigation_controller.h" |
| 12 #include "chrome/browser/tab_contents/navigation_entry.h" | 12 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 13 #include "chrome/browser/tab_contents/tab_contents.h" | 13 #include "chrome/browser/tab_contents/tab_contents.h" |
| 14 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
| 15 #include "chrome/common/pref_service.h" | 15 #include "chrome/common/pref_service.h" |
| 16 #include "chrome/common/url_constants.h" |
| 16 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
| 17 #include "net/base/net_util.h" | 18 #include "net/base/net_util.h" |
| 18 | 19 |
| 19 ToolbarModel::ToolbarModel() : input_in_progress_(false) { | 20 ToolbarModel::ToolbarModel() : input_in_progress_(false) { |
| 20 } | 21 } |
| 21 | 22 |
| 22 ToolbarModel::~ToolbarModel() { | 23 ToolbarModel::~ToolbarModel() { |
| 23 } | 24 } |
| 24 | 25 |
| 25 // ToolbarModel Implementation. | 26 // ToolbarModel Implementation. |
| 26 std::wstring ToolbarModel::GetText() { | 27 std::wstring ToolbarModel::GetText() { |
| 27 static const GURL kAboutBlankURL("about:blank"); | 28 GURL url(chrome::kAboutBlankURL); |
| 28 GURL url(kAboutBlankURL); | |
| 29 std::wstring languages; // Empty if we don't have a |navigation_controller|. | 29 std::wstring languages; // Empty if we don't have a |navigation_controller|. |
| 30 | 30 |
| 31 NavigationController* navigation_controller = GetNavigationController(); | 31 NavigationController* navigation_controller = GetNavigationController(); |
| 32 if (navigation_controller) { | 32 if (navigation_controller) { |
| 33 languages = navigation_controller->profile()->GetPrefs()->GetString( | 33 languages = navigation_controller->profile()->GetPrefs()->GetString( |
| 34 prefs::kAcceptLanguages); | 34 prefs::kAcceptLanguages); |
| 35 NavigationEntry* entry = navigation_controller->GetActiveEntry(); | 35 NavigationEntry* entry = navigation_controller->GetActiveEntry(); |
| 36 // We may not have a navigation entry yet | 36 // We may not have a navigation entry yet |
| 37 if (!navigation_controller->tab_contents()->ShouldDisplayURL()) { | 37 if (!navigation_controller->tab_contents()->ShouldDisplayURL()) { |
| 38 // Explicitly hide the URL for this tab. | 38 // Explicitly hide the URL for this tab. |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 // Multiple errors. | 205 // Multiple errors. |
| 206 text->assign(l10n_util::GetString(IDS_SEVERAL_SSL_ERRORS)); | 206 text->assign(l10n_util::GetString(IDS_SEVERAL_SSL_ERRORS)); |
| 207 text->append(L"\n"); | 207 text->append(L"\n"); |
| 208 for (int i = 0; i < error_count; ++i) { | 208 for (int i = 0; i < error_count; ++i) { |
| 209 text->append(errors[i].short_description()); | 209 text->append(errors[i].short_description()); |
| 210 if (i != error_count - 1) | 210 if (i != error_count - 1) |
| 211 text->append(L"\n"); | 211 text->append(L"\n"); |
| 212 } | 212 } |
| 213 } | 213 } |
| 214 } | 214 } |
| OLD | NEW |