| 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/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 | 376 |
| 377 // DropdownBarHostDelegate | 377 // DropdownBarHostDelegate |
| 378 void LocationBarView::SetFocusAndSelection(bool select_all) { | 378 void LocationBarView::SetFocusAndSelection(bool select_all) { |
| 379 FocusLocation(select_all); | 379 FocusLocation(select_all); |
| 380 } | 380 } |
| 381 | 381 |
| 382 void LocationBarView::SetAnimationOffset(int offset) { | 382 void LocationBarView::SetAnimationOffset(int offset) { |
| 383 animation_offset_ = offset; | 383 animation_offset_ = offset; |
| 384 } | 384 } |
| 385 | 385 |
| 386 void LocationBarView::ModeChanged(const chrome::search::Mode& mode) { | 386 void LocationBarView::ModeChanged(const chrome::search::Mode& old_mode, |
| 387 const chrome::search::Mode& new_mode) { |
| 387 #if defined(USE_AURA) | 388 #if defined(USE_AURA) |
| 388 if (mode.is_search() && mode.animate) { | 389 if (new_mode.is_search() && new_mode.animate) { |
| 389 // Fade in so the icons don't pop. | 390 // Fade in so the icons don't pop. |
| 390 StartFadeAnimation(); | 391 StartFadeAnimation(); |
| 391 } else { | 392 } else { |
| 392 // Cancel any pending animations; switch to the final state immediately. | 393 // Cancel any pending animations; switch to the final state immediately. |
| 393 StopFadeAnimation(); | 394 StopFadeAnimation(); |
| 394 } | 395 } |
| 395 #endif | 396 #endif |
| 396 } | 397 } |
| 397 | 398 |
| 398 void LocationBarView::Update(const WebContents* tab_for_state_restoring) { | 399 void LocationBarView::Update(const WebContents* tab_for_state_restoring) { |
| (...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1499 } | 1500 } |
| 1500 | 1501 |
| 1501 void LocationBarView::CleanupFadeAnimation() { | 1502 void LocationBarView::CleanupFadeAnimation() { |
| 1502 // Since we're no longer animating we don't need our layer. | 1503 // Since we're no longer animating we don't need our layer. |
| 1503 SetPaintToLayer(false); | 1504 SetPaintToLayer(false); |
| 1504 // Bubble labels don't need a transparent background anymore. | 1505 // Bubble labels don't need a transparent background anymore. |
| 1505 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1506 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
| 1506 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1507 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
| 1507 } | 1508 } |
| 1508 #endif // USE_AURA | 1509 #endif // USE_AURA |
| OLD | NEW |