| 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 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1267 } | 1267 } |
| 1268 | 1268 |
| 1269 //////////////////////////////////////////////////////////////////////////////// | 1269 //////////////////////////////////////////////////////////////////////////////// |
| 1270 // LocationBarView, private views::View implementation: | 1270 // LocationBarView, private views::View implementation: |
| 1271 | 1271 |
| 1272 const char* LocationBarView::GetClassName() const { | 1272 const char* LocationBarView::GetClassName() const { |
| 1273 return kViewClassName; | 1273 return kViewClassName; |
| 1274 } | 1274 } |
| 1275 | 1275 |
| 1276 void LocationBarView::OnBoundsChanged(const gfx::Rect& previous_bounds) { | 1276 void LocationBarView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
| 1277 InstantServiceFactory::GetForProfile(profile())->OnOmniboxStartMarginChanged( | 1277 InstantService* instant_service = |
| 1278 bounds().x()); | 1278 InstantServiceFactory::GetForProfile(profile()); |
| 1279 if (instant_service) |
| 1280 instant_service->OnOmniboxStartMarginChanged(bounds().x()); |
| 1279 | 1281 |
| 1280 OmniboxPopupView* popup = omnibox_view_->model()->popup_model()->view(); | 1282 OmniboxPopupView* popup = omnibox_view_->model()->popup_model()->view(); |
| 1281 if (popup->IsOpen()) | 1283 if (popup->IsOpen()) |
| 1282 popup->UpdatePopupAppearance(); | 1284 popup->UpdatePopupAppearance(); |
| 1283 } | 1285 } |
| 1284 | 1286 |
| 1285 void LocationBarView::OnFocus() { | 1287 void LocationBarView::OnFocus() { |
| 1286 // Explicitly focus the omnibox so a focus ring will be displayed around it on | 1288 // Explicitly focus the omnibox so a focus ring will be displayed around it on |
| 1287 // Windows. | 1289 // Windows. |
| 1288 omnibox_view_->SetFocus(); | 1290 omnibox_view_->SetFocus(); |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1443 | 1445 |
| 1444 void LocationBarView::ModelChanged(const SearchModel::State& old_state, | 1446 void LocationBarView::ModelChanged(const SearchModel::State& old_state, |
| 1445 const SearchModel::State& new_state) { | 1447 const SearchModel::State& new_state) { |
| 1446 const bool visible = !GetToolbarModel()->input_in_progress() && | 1448 const bool visible = !GetToolbarModel()->input_in_progress() && |
| 1447 new_state.voice_search_supported; | 1449 new_state.voice_search_supported; |
| 1448 if (mic_search_view_->visible() != visible) { | 1450 if (mic_search_view_->visible() != visible) { |
| 1449 mic_search_view_->SetVisible(visible); | 1451 mic_search_view_->SetVisible(visible); |
| 1450 Layout(); | 1452 Layout(); |
| 1451 } | 1453 } |
| 1452 } | 1454 } |
| OLD | NEW |