OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 show_focus_rect_(false), | 224 show_focus_rect_(false), |
225 template_url_service_(NULL), | 225 template_url_service_(NULL), |
226 dropdown_animation_offset_(0), | 226 dropdown_animation_offset_(0), |
227 starting_omnibox_offset_(0), | 227 starting_omnibox_offset_(0), |
228 current_omnibox_offset_(0), | 228 current_omnibox_offset_(0), |
229 starting_omnibox_leading_inset_(0), | 229 starting_omnibox_leading_inset_(0), |
230 current_omnibox_leading_inset_(0), | 230 current_omnibox_leading_inset_(0), |
231 current_omnibox_width_(0), | 231 current_omnibox_width_(0), |
232 ending_omnibox_width_(0) { | 232 ending_omnibox_width_(0) { |
233 edit_bookmarks_enabled_.Init( | 233 edit_bookmarks_enabled_.Init( |
234 prefs::kEditBookmarksEnabled, profile->GetPrefs(), | 234 bookmarks::prefs::kEditBookmarksEnabled, profile->GetPrefs(), |
235 base::Bind(&LocationBarView::Update, base::Unretained(this), | 235 base::Bind(&LocationBarView::Update, base::Unretained(this), |
236 static_cast<content::WebContents*>(NULL))); | 236 static_cast<content::WebContents*>(NULL))); |
237 | 237 |
238 if (browser_) | 238 if (browser_) |
239 browser_->search_model()->AddObserver(this); | 239 browser_->search_model()->AddObserver(this); |
240 } | 240 } |
241 | 241 |
242 LocationBarView::~LocationBarView() { | 242 LocationBarView::~LocationBarView() { |
243 if (template_url_service_) | 243 if (template_url_service_) |
244 template_url_service_->RemoveObserver(this); | 244 template_url_service_->RemoveObserver(this); |
(...skipping 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1687 | 1687 |
1688 void LocationBarView::ModelChanged(const SearchModel::State& old_state, | 1688 void LocationBarView::ModelChanged(const SearchModel::State& old_state, |
1689 const SearchModel::State& new_state) { | 1689 const SearchModel::State& new_state) { |
1690 const bool visible = !GetToolbarModel()->input_in_progress() && | 1690 const bool visible = !GetToolbarModel()->input_in_progress() && |
1691 new_state.voice_search_supported; | 1691 new_state.voice_search_supported; |
1692 if (mic_search_view_->visible() != visible) { | 1692 if (mic_search_view_->visible() != visible) { |
1693 mic_search_view_->SetVisible(visible); | 1693 mic_search_view_->SetVisible(visible); |
1694 Layout(); | 1694 Layout(); |
1695 } | 1695 } |
1696 } | 1696 } |
OLD | NEW |