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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 // LocationBarView ----------------------------------------------------------- | 104 // LocationBarView ----------------------------------------------------------- |
105 | 105 |
106 LocationBarView::LocationBarView(Browser* browser, | 106 LocationBarView::LocationBarView(Browser* browser, |
107 ToolbarModel* model, | 107 ToolbarModel* model, |
108 Delegate* delegate, | 108 Delegate* delegate, |
109 Mode mode) | 109 Mode mode) |
110 : browser_(browser), | 110 : browser_(browser), |
111 model_(model), | 111 model_(model), |
112 delegate_(delegate), | 112 delegate_(delegate), |
113 disposition_(CURRENT_TAB), | 113 disposition_(CURRENT_TAB), |
114 transition_(PageTransition::LINK), | 114 transition_(PageTransition::TYPED | PageTransition::FROM_ADDRESS_BAR), |
115 location_icon_view_(NULL), | 115 location_icon_view_(NULL), |
116 ev_bubble_view_(NULL), | 116 ev_bubble_view_(NULL), |
117 location_entry_view_(NULL), | 117 location_entry_view_(NULL), |
118 selected_keyword_view_(NULL), | 118 selected_keyword_view_(NULL), |
119 #if defined(OS_WIN) | 119 #if defined(OS_WIN) |
120 suggested_text_view_(NULL), | 120 suggested_text_view_(NULL), |
121 #endif | 121 #endif |
122 keyword_hint_view_(NULL), | 122 keyword_hint_view_(NULL), |
123 star_view_(NULL), | 123 star_view_(NULL), |
124 mode_(mode), | 124 mode_(mode), |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 void LocationBarView::OnAutocompleteAccept( | 799 void LocationBarView::OnAutocompleteAccept( |
800 const GURL& url, | 800 const GURL& url, |
801 WindowOpenDisposition disposition, | 801 WindowOpenDisposition disposition, |
802 PageTransition::Type transition, | 802 PageTransition::Type transition, |
803 const GURL& alternate_nav_url) { | 803 const GURL& alternate_nav_url) { |
804 // WARNING: don't add an early return here. The calls after the if must | 804 // WARNING: don't add an early return here. The calls after the if must |
805 // happen. | 805 // happen. |
806 if (url.is_valid()) { | 806 if (url.is_valid()) { |
807 location_input_ = UTF8ToUTF16(url.spec()); | 807 location_input_ = UTF8ToUTF16(url.spec()); |
808 disposition_ = disposition; | 808 disposition_ = disposition; |
809 transition_ = transition; | 809 transition_ = transition | PageTransition::FROM_ADDRESS_BAR; |
810 | 810 |
811 if (browser_->command_updater()) { | 811 if (browser_->command_updater()) { |
812 if (!alternate_nav_url.is_valid()) { | 812 if (!alternate_nav_url.is_valid()) { |
813 browser_->command_updater()->ExecuteCommand(IDC_OPEN_CURRENT_URL); | 813 browser_->command_updater()->ExecuteCommand(IDC_OPEN_CURRENT_URL); |
814 } else { | 814 } else { |
815 AlternateNavURLFetcher* fetcher = | 815 AlternateNavURLFetcher* fetcher = |
816 new AlternateNavURLFetcher(alternate_nav_url); | 816 new AlternateNavURLFetcher(alternate_nav_url); |
817 // The AlternateNavURLFetcher will listen for the pending navigation | 817 // The AlternateNavURLFetcher will listen for the pending navigation |
818 // notification that will be issued as a result of the "open URL." It | 818 // notification that will be issued as a result of the "open URL." It |
819 // will automatically install itself into that navigation controller. | 819 // will automatically install itself into that navigation controller. |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1242 bool LocationBarView::HasValidSuggestText() const { | 1242 bool LocationBarView::HasValidSuggestText() const { |
1243 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && | 1243 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && |
1244 !suggested_text_view_->GetText().empty(); | 1244 !suggested_text_view_->GetText().empty(); |
1245 } | 1245 } |
1246 | 1246 |
1247 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() { | 1247 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() { |
1248 CHECK(!views::Widget::IsPureViews()); | 1248 CHECK(!views::Widget::IsPureViews()); |
1249 return static_cast<OmniboxViewWin*>(location_entry_.get()); | 1249 return static_cast<OmniboxViewWin*>(location_entry_.get()); |
1250 } | 1250 } |
1251 #endif | 1251 #endif |
OLD | NEW |