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/views/location_bar/location_bar_view.h" | 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
6 | 6 |
7 #if defined(TOOLKIT_USES_GTK) | 7 #if defined(TOOLKIT_USES_GTK) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 #endif | 810 #endif |
811 | 811 |
812 void LocationBarView::OnAutocompleteAccept( | 812 void LocationBarView::OnAutocompleteAccept( |
813 const GURL& url, | 813 const GURL& url, |
814 WindowOpenDisposition disposition, | 814 WindowOpenDisposition disposition, |
815 PageTransition::Type transition, | 815 PageTransition::Type transition, |
816 const GURL& alternate_nav_url) { | 816 const GURL& alternate_nav_url) { |
817 // WARNING: don't add an early return here. The calls after the if must | 817 // WARNING: don't add an early return here. The calls after the if must |
818 // happen. | 818 // happen. |
819 if (url.is_valid()) { | 819 if (url.is_valid()) { |
820 location_input_ = UTF8ToWide(url.spec()); | 820 location_input_ = UTF8ToUTF16(url.spec()); |
821 disposition_ = disposition; | 821 disposition_ = disposition; |
822 transition_ = transition; | 822 transition_ = transition; |
823 | 823 |
824 if (browser_->command_updater()) { | 824 if (browser_->command_updater()) { |
825 if (!alternate_nav_url.is_valid()) { | 825 if (!alternate_nav_url.is_valid()) { |
826 browser_->command_updater()->ExecuteCommand(IDC_OPEN_CURRENT_URL); | 826 browser_->command_updater()->ExecuteCommand(IDC_OPEN_CURRENT_URL); |
827 } else { | 827 } else { |
828 AlternateNavURLFetcher* fetcher = | 828 AlternateNavURLFetcher* fetcher = |
829 new AlternateNavURLFetcher(alternate_nav_url); | 829 new AlternateNavURLFetcher(alternate_nav_url); |
830 // The AlternateNavURLFetcher will listen for the pending navigation | 830 // The AlternateNavURLFetcher will listen for the pending navigation |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 return; | 1124 return; |
1125 } | 1125 } |
1126 ShowFirstRunBubbleInternal(bubble_type); | 1126 ShowFirstRunBubbleInternal(bubble_type); |
1127 } | 1127 } |
1128 | 1128 |
1129 void LocationBarView::SetSuggestedText(const string16& text, | 1129 void LocationBarView::SetSuggestedText(const string16& text, |
1130 InstantCompleteBehavior behavior) { | 1130 InstantCompleteBehavior behavior) { |
1131 location_entry_->model()->SetSuggestedText(text, behavior); | 1131 location_entry_->model()->SetSuggestedText(text, behavior); |
1132 } | 1132 } |
1133 | 1133 |
1134 std::wstring LocationBarView::GetInputString() const { | 1134 string16 LocationBarView::GetInputString() const { |
1135 return location_input_; | 1135 return location_input_; |
1136 } | 1136 } |
1137 | 1137 |
1138 WindowOpenDisposition LocationBarView::GetWindowOpenDisposition() const { | 1138 WindowOpenDisposition LocationBarView::GetWindowOpenDisposition() const { |
1139 return disposition_; | 1139 return disposition_; |
1140 } | 1140 } |
1141 | 1141 |
1142 PageTransition::Type LocationBarView::GetPageTransition() const { | 1142 PageTransition::Type LocationBarView::GetPageTransition() const { |
1143 return transition_; | 1143 return transition_; |
1144 } | 1144 } |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1254 bool LocationBarView::HasValidSuggestText() const { | 1254 bool LocationBarView::HasValidSuggestText() const { |
1255 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && | 1255 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && |
1256 !suggested_text_view_->GetText().empty(); | 1256 !suggested_text_view_->GetText().empty(); |
1257 } | 1257 } |
1258 | 1258 |
1259 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() { | 1259 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() { |
1260 CHECK(!views::Widget::IsPureViews()); | 1260 CHECK(!views::Widget::IsPureViews()); |
1261 return static_cast<OmniboxViewWin*>(location_entry_.get()); | 1261 return static_cast<OmniboxViewWin*>(location_entry_.get()); |
1262 } | 1262 } |
1263 #endif | 1263 #endif |
OLD | NEW |