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

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

Issue 6256010: Revert 72380 - Remove wstring from autocomplete.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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
Property Changes:
Added: svn:mergeinfo
OLDNEW
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/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/cert_store.h" 10 #include "chrome/browser/cert_store.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 url = GURL(); 46 url = GURL();
47 } else if (entry) { 47 } else if (entry) {
48 url = entry->virtual_url(); 48 url = entry->virtual_url();
49 } 49 }
50 } 50 }
51 if (url.spec().length() > chrome::kMaxURLDisplayChars) 51 if (url.spec().length() > chrome::kMaxURLDisplayChars)
52 url = url.IsStandard() ? url.GetOrigin() : GURL(url.scheme() + ":"); 52 url = url.IsStandard() ? url.GetOrigin() : GURL(url.scheme() + ":");
53 // Note that we can't unescape spaces here, because if the user copies this 53 // Note that we can't unescape spaces here, because if the user copies this
54 // and pastes it into another program, that program may think the URL ends at 54 // and pastes it into another program, that program may think the URL ends at
55 // the space. 55 // the space.
56 return UTF16ToWideHack( 56 return AutocompleteInput::FormattedStringWithEquivalentMeaning(url,
57 AutocompleteInput::FormattedStringWithEquivalentMeaning( 57 UTF16ToWideHack(net::FormatUrl(url, languages, net::kFormatUrlOmitAll,
58 url, 58 UnescapeRule::NORMAL, NULL, NULL, NULL)));
59 net::FormatUrl(url, languages, net::kFormatUrlOmitAll,
60 UnescapeRule::NORMAL, NULL, NULL, NULL)));
61 } 59 }
62 60
63 ToolbarModel::SecurityLevel ToolbarModel::GetSecurityLevel() const { 61 ToolbarModel::SecurityLevel ToolbarModel::GetSecurityLevel() const {
64 if (input_in_progress_) // When editing, assume no security style. 62 if (input_in_progress_) // When editing, assume no security style.
65 return NONE; 63 return NONE;
66 64
67 NavigationController* navigation_controller = GetNavigationController(); 65 NavigationController* navigation_controller = GetNavigationController();
68 if (!navigation_controller) // We might not have a controller on init. 66 if (!navigation_controller) // We might not have a controller on init.
69 return NONE; 67 return NONE;
70 68
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 return UTF16ToWideHack(SSLManager::GetEVCertName(*cert)); 120 return UTF16ToWideHack(SSLManager::GetEVCertName(*cert));
123 } 121 }
124 122
125 NavigationController* ToolbarModel::GetNavigationController() const { 123 NavigationController* ToolbarModel::GetNavigationController() const {
126 // This |current_tab| can be NULL during the initialization of the 124 // This |current_tab| can be NULL during the initialization of the
127 // toolbar during window creation (i.e. before any tabs have been added 125 // toolbar during window creation (i.e. before any tabs have been added
128 // to the window). 126 // to the window).
129 TabContents* current_tab = browser_->GetSelectedTabContents(); 127 TabContents* current_tab = browser_->GetSelectedTabContents();
130 return current_tab ? &current_tab->controller() : NULL; 128 return current_tab ? &current_tab->controller() : NULL;
131 } 129 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc ('k') | chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698