| 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/toolbar/toolbar_model.h" | 5 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/autocomplete/autocomplete.h" | 8 #include "chrome/browser/autocomplete/autocomplete.h" |
| 9 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 9 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
| 10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 NavigationEntry* entry = controller ? controller->GetVisibleEntry() : NULL; | 79 NavigationEntry* entry = controller ? controller->GetVisibleEntry() : NULL; |
| 80 if (entry) { | 80 if (entry) { |
| 81 if (entry->IsViewSourceMode() || | 81 if (entry->IsViewSourceMode() || |
| 82 entry->GetPageType() == content::PAGE_TYPE_INTERSTITIAL) { | 82 entry->GetPageType() == content::PAGE_TYPE_INTERSTITIAL) { |
| 83 return true; | 83 return true; |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 | 86 |
| 87 WebContents* web_contents = browser_->GetSelectedWebContents(); | 87 WebContents* web_contents = browser_->GetSelectedWebContents(); |
| 88 if (web_contents && web_contents->GetWebUIForCurrentState()) | 88 if (web_contents && web_contents->GetWebUIForCurrentState()) |
| 89 return !web_contents->GetWebUIForCurrentState()->should_hide_url(); | 89 return !web_contents->GetWebUIForCurrentState()->ShouldHideURL(); |
| 90 | 90 |
| 91 if (entry && entry->GetURL().SchemeIs(chrome::kExtensionScheme)) | 91 if (entry && entry->GetURL().SchemeIs(chrome::kExtensionScheme)) |
| 92 return false; | 92 return false; |
| 93 | 93 |
| 94 return true; | 94 return true; |
| 95 } | 95 } |
| 96 | 96 |
| 97 ToolbarModel::SecurityLevel ToolbarModel::GetSecurityLevel() const { | 97 ToolbarModel::SecurityLevel ToolbarModel::GetSecurityLevel() const { |
| 98 if (input_in_progress_) // When editing, assume no security style. | 98 if (input_in_progress_) // When editing, assume no security style. |
| 99 return NONE; | 99 return NONE; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 UTF8ToUTF16(cert.subject().country_name)); | 170 UTF8ToUTF16(cert.subject().country_name)); |
| 171 } | 171 } |
| 172 | 172 |
| 173 NavigationController* ToolbarModel::GetNavigationController() const { | 173 NavigationController* ToolbarModel::GetNavigationController() const { |
| 174 // This |current_tab| can be NULL during the initialization of the | 174 // This |current_tab| can be NULL during the initialization of the |
| 175 // toolbar during window creation (i.e. before any tabs have been added | 175 // toolbar during window creation (i.e. before any tabs have been added |
| 176 // to the window). | 176 // to the window). |
| 177 WebContents* current_tab = browser_->GetSelectedWebContents(); | 177 WebContents* current_tab = browser_->GetSelectedWebContents(); |
| 178 return current_tab ? ¤t_tab->GetController() : NULL; | 178 return current_tab ? ¤t_tab->GetController() : NULL; |
| 179 } | 179 } |
| OLD | NEW |