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