Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(946)

Side by Side Diff: chrome/browser/ui/views/toolbar_view.cc

Issue 11040055: Adds a FakeToolbarModel for use in testing. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: git try Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/views/location_bar/zoom_view.cc ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 return views::BubbleDelegateView::CreateBubble(bubble_delegate); 514 return views::BubbleDelegateView::CreateBubble(bubble_delegate);
515 } 515 }
516 516
517 PageActionImageView* ToolbarView::CreatePageActionImageView( 517 PageActionImageView* ToolbarView::CreatePageActionImageView(
518 LocationBarView* owner, ExtensionAction* action) { 518 LocationBarView* owner, ExtensionAction* action) {
519 return new PageActionImageView(owner, action, browser_); 519 return new PageActionImageView(owner, action, browser_);
520 } 520 }
521 521
522 void ToolbarView::OnInputInProgress(bool in_progress) { 522 void ToolbarView::OnInputInProgress(bool in_progress) {
523 // The edit should make sure we're only notified when something changes. 523 // The edit should make sure we're only notified when something changes.
524 DCHECK(model_->input_in_progress() != in_progress); 524 DCHECK(model_->GetInputInProgress() != in_progress);
525 525
526 model_->set_input_in_progress(in_progress); 526 model_->SetInputInProgress(in_progress);
527 location_bar_->Update(NULL); 527 location_bar_->Update(NULL);
528 } 528 }
529 529
530 //////////////////////////////////////////////////////////////////////////////// 530 ////////////////////////////////////////////////////////////////////////////////
531 // ToolbarView, chrome::search::SearchModelObserver implementation: 531 // ToolbarView, chrome::search::SearchModelObserver implementation:
532 void ToolbarView::ModeChanged(const chrome::search::Mode& old_mode, 532 void ToolbarView::ModeChanged(const chrome::search::Mode& old_mode,
533 const chrome::search::Mode& new_mode) { 533 const chrome::search::Mode& new_mode) {
534 // Layout location bar to determine the visibility of each of its child 534 // Layout location bar to determine the visibility of each of its child
535 // view based on toolbar mode change. 535 // view based on toolbar mode change.
536 if (new_mode.is_ntp()) 536 if (new_mode.is_ntp())
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 // LocationBarContainer is not a child of the ToolbarView. 1026 // LocationBarContainer is not a child of the ToolbarView.
1027 gfx::Point origin(bounds.origin()); 1027 gfx::Point origin(bounds.origin());
1028 views::View::ConvertPointToTarget(this, location_bar_container_->parent(), 1028 views::View::ConvertPointToTarget(this, location_bar_container_->parent(),
1029 &origin); 1029 &origin);
1030 gfx::Rect target_bounds(origin, bounds.size()); 1030 gfx::Rect target_bounds(origin, bounds.size());
1031 if (location_bar_container_->GetTargetBounds() != target_bounds) { 1031 if (location_bar_container_->GetTargetBounds() != target_bounds) {
1032 location_bar_container_->SetInToolbar(true); 1032 location_bar_container_->SetInToolbar(true);
1033 location_bar_container_->SetBoundsRect(target_bounds); 1033 location_bar_container_->SetBoundsRect(target_bounds);
1034 } 1034 }
1035 } 1035 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/location_bar/zoom_view.cc ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698