| 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 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1261 } | 1261 } |
| 1262 | 1262 |
| 1263 //////////////////////////////////////////////////////////////////////////////// | 1263 //////////////////////////////////////////////////////////////////////////////// |
| 1264 // LocationBarView, private views::View implementation: | 1264 // LocationBarView, private views::View implementation: |
| 1265 | 1265 |
| 1266 const char* LocationBarView::GetClassName() const { | 1266 const char* LocationBarView::GetClassName() const { |
| 1267 return kViewClassName; | 1267 return kViewClassName; |
| 1268 } | 1268 } |
| 1269 | 1269 |
| 1270 void LocationBarView::OnBoundsChanged(const gfx::Rect& previous_bounds) { | 1270 void LocationBarView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
| 1271 InstantServiceFactory::GetForProfile(profile())->OnOmniboxStartMarginChanged( | 1271 InstantService* instant_service = |
| 1272 bounds().x()); | 1272 InstantServiceFactory::GetForProfile(profile()); |
| 1273 if (instant_service) |
| 1274 instant_service->OnOmniboxStartMarginChanged(bounds().x()); |
| 1273 | 1275 |
| 1274 OmniboxPopupView* popup = omnibox_view_->model()->popup_model()->view(); | 1276 OmniboxPopupView* popup = omnibox_view_->model()->popup_model()->view(); |
| 1275 if (popup->IsOpen()) | 1277 if (popup->IsOpen()) |
| 1276 popup->UpdatePopupAppearance(); | 1278 popup->UpdatePopupAppearance(); |
| 1277 } | 1279 } |
| 1278 | 1280 |
| 1279 void LocationBarView::OnFocus() { | 1281 void LocationBarView::OnFocus() { |
| 1280 // Explicitly focus the omnibox so a focus ring will be displayed around it on | 1282 // Explicitly focus the omnibox so a focus ring will be displayed around it on |
| 1281 // Windows. | 1283 // Windows. |
| 1282 omnibox_view_->SetFocus(); | 1284 omnibox_view_->SetFocus(); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1430 | 1432 |
| 1431 void LocationBarView::ModelChanged(const SearchModel::State& old_state, | 1433 void LocationBarView::ModelChanged(const SearchModel::State& old_state, |
| 1432 const SearchModel::State& new_state) { | 1434 const SearchModel::State& new_state) { |
| 1433 const bool visible = !GetToolbarModel()->input_in_progress() && | 1435 const bool visible = !GetToolbarModel()->input_in_progress() && |
| 1434 new_state.voice_search_supported; | 1436 new_state.voice_search_supported; |
| 1435 if (mic_search_view_->visible() != visible) { | 1437 if (mic_search_view_->visible() != visible) { |
| 1436 mic_search_view_->SetVisible(visible); | 1438 mic_search_view_->SetVisible(visible); |
| 1437 Layout(); | 1439 Layout(); |
| 1438 } | 1440 } |
| 1439 } | 1441 } |
| OLD | NEW |