| 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/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1434 | 1434 |
| 1435 void LocationBarView::OnBoundsChanged(const gfx::Rect& previous_bounds) { | 1435 void LocationBarView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
| 1436 InstantServiceFactory::GetForProfile(profile())->OnOmniboxStartMarginChanged( | 1436 InstantServiceFactory::GetForProfile(profile())->OnOmniboxStartMarginChanged( |
| 1437 bounds().x()); | 1437 bounds().x()); |
| 1438 | 1438 |
| 1439 OmniboxPopupView* popup = omnibox_view_->model()->popup_model()->view(); | 1439 OmniboxPopupView* popup = omnibox_view_->model()->popup_model()->view(); |
| 1440 if (popup->IsOpen()) | 1440 if (popup->IsOpen()) |
| 1441 popup->UpdatePopupAppearance(); | 1441 popup->UpdatePopupAppearance(); |
| 1442 } | 1442 } |
| 1443 | 1443 |
| 1444 void LocationBarView::OnFocus() { |
| 1445 // Explicitly focus the omnibox so a focus ring will be displayed around it on |
| 1446 // Windows. |
| 1447 omnibox_view_->SetFocus(); |
| 1448 } |
| 1449 |
| 1444 void LocationBarView::OnPaint(gfx::Canvas* canvas) { | 1450 void LocationBarView::OnPaint(gfx::Canvas* canvas) { |
| 1445 View::OnPaint(canvas); | 1451 View::OnPaint(canvas); |
| 1446 | 1452 |
| 1447 // Fill the location bar background color behind the border. Parts of the | 1453 // Fill the location bar background color behind the border. Parts of the |
| 1448 // border images are meant to rest atop the toolbar background and parts atop | 1454 // border images are meant to rest atop the toolbar background and parts atop |
| 1449 // the omnibox background, so we can't just blindly fill our entire bounds. | 1455 // the omnibox background, so we can't just blindly fill our entire bounds. |
| 1450 gfx::Rect bounds(GetContentsBounds()); | 1456 gfx::Rect bounds(GetContentsBounds()); |
| 1451 bounds.Inset(GetHorizontalEdgeThickness(), vertical_edge_thickness()); | 1457 bounds.Inset(GetHorizontalEdgeThickness(), vertical_edge_thickness()); |
| 1452 SkColor color(GetColor(ToolbarModel::NONE, BACKGROUND)); | 1458 SkColor color(GetColor(ToolbarModel::NONE, BACKGROUND)); |
| 1453 if (is_popup_mode_) { | 1459 if (is_popup_mode_) { |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1670 void LocationBarView::ModelChanged(const SearchModel::State& old_state, | 1676 void LocationBarView::ModelChanged(const SearchModel::State& old_state, |
| 1671 const SearchModel::State& new_state) { | 1677 const SearchModel::State& new_state) { |
| 1672 const bool visible = !GetToolbarModel()->input_in_progress() && | 1678 const bool visible = !GetToolbarModel()->input_in_progress() && |
| 1673 new_state.voice_search_supported; | 1679 new_state.voice_search_supported; |
| 1674 if (mic_search_view_->visible() != visible) { | 1680 if (mic_search_view_->visible() != visible) { |
| 1675 mic_search_view_->SetVisible(visible); | 1681 mic_search_view_->SetVisible(visible); |
| 1676 Layout(); | 1682 Layout(); |
| 1677 } | 1683 } |
| 1678 } | 1684 } |
| 1679 | 1685 |
| OLD | NEW |