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/toolbar_view.h" | 5 #include "chrome/browser/ui/views/toolbar_view.h" |
6 | 6 |
7 #include "base/i18n/number_formatting.h" | 7 #include "base/i18n/number_formatting.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/command_updater.h" | 10 #include "chrome/browser/command_updater.h" |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 void ToolbarView::OnInputInProgress(bool in_progress) { | 481 void ToolbarView::OnInputInProgress(bool in_progress) { |
482 // The edit should make sure we're only notified when something changes. | 482 // The edit should make sure we're only notified when something changes. |
483 DCHECK(model_->input_in_progress() != in_progress); | 483 DCHECK(model_->input_in_progress() != in_progress); |
484 | 484 |
485 model_->set_input_in_progress(in_progress); | 485 model_->set_input_in_progress(in_progress); |
486 location_bar_->Update(NULL); | 486 location_bar_->Update(NULL); |
487 } | 487 } |
488 | 488 |
489 //////////////////////////////////////////////////////////////////////////////// | 489 //////////////////////////////////////////////////////////////////////////////// |
490 // ToolbarView, chrome::search::SearchModelObserver implementation: | 490 // ToolbarView, chrome::search::SearchModelObserver implementation: |
491 void ToolbarView::ModeChanged(const chrome::search::Mode& mode) { | 491 void ToolbarView::ModeChanged(const chrome::search::Mode& old_mode, |
| 492 const chrome::search::Mode& new_mode) { |
492 // Layout location bar to determine the visibility of each of its child | 493 // Layout location bar to determine the visibility of each of its child |
493 // view based on toolbar mode change. | 494 // view based on toolbar mode change. |
494 if (mode.is_ntp()) | 495 if (new_mode.is_ntp()) |
495 location_bar_->Layout(); | 496 location_bar_->Layout(); |
496 | 497 |
497 Layout(); | 498 Layout(); |
498 LayoutForSearch(); | 499 LayoutForSearch(); |
499 SchedulePaint(); | 500 SchedulePaint(); |
500 } | 501 } |
501 | 502 |
502 //////////////////////////////////////////////////////////////////////////////// | 503 //////////////////////////////////////////////////////////////////////////////// |
503 // ToolbarView, CommandObserver implementation: | 504 // ToolbarView, CommandObserver implementation: |
504 | 505 |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1026 // LocationBarContainer is not a child of the ToolbarView. | 1027 // LocationBarContainer is not a child of the ToolbarView. |
1027 gfx::Point origin(bounds.origin()); | 1028 gfx::Point origin(bounds.origin()); |
1028 views::View::ConvertPointToView(this, location_bar_container_->parent(), | 1029 views::View::ConvertPointToView(this, location_bar_container_->parent(), |
1029 &origin); | 1030 &origin); |
1030 gfx::Rect target_bounds(origin, bounds.size()); | 1031 gfx::Rect target_bounds(origin, bounds.size()); |
1031 if (location_bar_container_->GetTargetBounds() != target_bounds) { | 1032 if (location_bar_container_->GetTargetBounds() != target_bounds) { |
1032 location_bar_container_->SetInToolbar(true); | 1033 location_bar_container_->SetInToolbar(true); |
1033 location_bar_container_->SetBoundsRect(target_bounds); | 1034 location_bar_container_->SetBoundsRect(target_bounds); |
1034 } | 1035 } |
1035 } | 1036 } |
OLD | NEW |