diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-04 07:58:34 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-04 07:58:34 +0000 |
commit | 57c6a6579cf274fe37d6196931a3034d90da7113 (patch) | |
tree | ec42313580156ccc039b5fee714ee12259cb08ee /chrome/browser/find_bar_controller.cc | |
parent | b23c9e1f05d474adc327c85d87eacc77554976e0 (diff) | |
download | chromium_src-57c6a6579cf274fe37d6196931a3034d90da7113.zip chromium_src-57c6a6579cf274fe37d6196931a3034d90da7113.tar.gz chromium_src-57c6a6579cf274fe37d6196931a3034d90da7113.tar.bz2 |
Replace all occurrances of WebContents with TabContents.
Review URL: http://codereview.chromium.org/99177
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15194 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/find_bar_controller.cc')
-rw-r--r-- | chrome/browser/find_bar_controller.cc | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/chrome/browser/find_bar_controller.cc b/chrome/browser/find_bar_controller.cc index fb5cf3b..07cd5e6 100644 --- a/chrome/browser/find_bar_controller.cc +++ b/chrome/browser/find_bar_controller.cc @@ -8,23 +8,23 @@ #include "chrome/browser/find_bar.h" #include "chrome/browser/tab_contents/navigation_entry.h" #include "chrome/common/notification_service.h" -#include "chrome/browser/tab_contents/web_contents.h" +#include "chrome/browser/tab_contents/tab_contents.h" FindBarController::FindBarController(FindBar* find_bar) - : find_bar_(find_bar), web_contents_(NULL) { + : find_bar_(find_bar), tab_contents_(NULL) { } FindBarController::~FindBarController() { // Web contents should have been NULLed out. If not, then we're leaking // notification observers. - DCHECK(!web_contents_); + DCHECK(!tab_contents_); } void FindBarController::Show() { // Only show the animation if we're not already showing a find bar for the - // selected WebContents. - if (!web_contents_->find_ui_active()) { - web_contents_->set_find_ui_active(true); + // selected TabContents. + if (!tab_contents_->find_ui_active()) { + tab_contents_->set_find_ui_active(true); find_bar_->Show(); } find_bar_->SetFocusAndSelection(); @@ -33,55 +33,55 @@ void FindBarController::Show() { void FindBarController::EndFindSession() { find_bar_->Hide(true); - // |web_contents_| can be NULL for a number of reasons, for example when the + // |tab_contents_| can be NULL for a number of reasons, for example when the // tab is closing. We must guard against that case. See issue 8030. - if (web_contents_) { + if (tab_contents_) { // When we hide the window, we need to notify the renderer that we are done // for now, so that we can abort the scoping effort and clear all the // tickmarks and highlighting. - web_contents_->StopFinding(false); // false = don't clear selection on + tab_contents_->StopFinding(false); // false = don't clear selection on // page. - find_bar_->ClearResults(web_contents_->find_result()); + find_bar_->ClearResults(tab_contents_->find_result()); // When we get dismissed we restore the focus to where it belongs. find_bar_->RestoreSavedFocus(); } } -void FindBarController::ChangeWebContents(WebContents* contents) { - if (web_contents_) { +void FindBarController::ChangeTabContents(TabContents* contents) { + if (tab_contents_) { NotificationService::current()->RemoveObserver( this, NotificationType::FIND_RESULT_AVAILABLE, - Source<TabContents>(web_contents_)); + Source<TabContents>(tab_contents_)); NotificationService::current()->RemoveObserver( this, NotificationType::NAV_ENTRY_COMMITTED, - Source<NavigationController>(&web_contents_->controller())); + Source<NavigationController>(&tab_contents_->controller())); find_bar_->StopAnimation(); } - web_contents_ = contents; + tab_contents_ = contents; - // Hide any visible find window from the previous tab if NULL |web_contents| + // Hide any visible find window from the previous tab if NULL |tab_contents| // is passed in or if the find UI is not active in the new tab. if (find_bar_->IsFindBarVisible() && - (!web_contents_ || !web_contents_->find_ui_active())) { + (!tab_contents_ || !tab_contents_->find_ui_active())) { find_bar_->Hide(false); } - if (web_contents_) { + if (tab_contents_) { NotificationService::current()->AddObserver( this, NotificationType::FIND_RESULT_AVAILABLE, - Source<TabContents>(web_contents_)); + Source<TabContents>(tab_contents_)); NotificationService::current()->AddObserver( this, NotificationType::NAV_ENTRY_COMMITTED, - Source<NavigationController>(&web_contents_->controller())); + Source<NavigationController>(&tab_contents_->controller())); // Find out what we should show in the find text box. Usually, this will be // the last search in this tab, but if no search has been issued in this tab // we use the last search string (from any tab). - string16 find_string = web_contents_->find_text(); + string16 find_string = tab_contents_->find_text(); if (find_string.empty()) - find_string = web_contents_->find_prepopulate_text(); + find_string = tab_contents_->find_prepopulate_text(); // Update the find bar with existing results and search text, regardless of // whether or not the find bar is visible, so that if it's subsequently @@ -90,7 +90,7 @@ void FindBarController::ChangeWebContents(WebContents* contents) { // clear the result count display when there's nothing in the box. find_bar_->SetFindText(find_string); - if (web_contents_->find_ui_active()) { + if (tab_contents_->find_ui_active()) { // A tab with a visible find bar just got selected and we need to show the // find bar but without animation since it was already animated into its // visible state. We also want to reset the window location so that @@ -104,8 +104,8 @@ void FindBarController::ChangeWebContents(WebContents* contents) { find_bar_->SetFocusAndSelection(); } - find_bar_->UpdateUIForFindResult(web_contents_->find_result(), - web_contents_->find_text()); + find_bar_->UpdateUIForFindResult(tab_contents_->find_result(), + tab_contents_->find_text()); } } @@ -118,14 +118,14 @@ void FindBarController::Observe(NotificationType type, if (type == NotificationType::FIND_RESULT_AVAILABLE) { // Don't update for notifications from TabContentses other than the one we // are actively tracking. - if (Source<TabContents>(source).ptr() == web_contents_) { - find_bar_->UpdateUIForFindResult(web_contents_->find_result(), - web_contents_->find_text()); + if (Source<TabContents>(source).ptr() == tab_contents_) { + find_bar_->UpdateUIForFindResult(tab_contents_->find_result(), + tab_contents_->find_text()); } } else if (type == NotificationType::NAV_ENTRY_COMMITTED) { NavigationController* source_controller = Source<NavigationController>(source).ptr(); - if (source_controller == &web_contents_->controller()) { + if (source_controller == &tab_contents_->controller()) { NavigationController::LoadCommittedDetails* commit_details = Details<NavigationController::LoadCommittedDetails>(details).ptr(); PageTransition::Type transition_type = @@ -139,7 +139,7 @@ void FindBarController::Observe(NotificationType type, } else { // On Reload we want to make sure FindNext is converted to a full Find // to make sure highlights for inactive matches are repainted. - web_contents_->set_find_op_aborted(true); + tab_contents_->set_find_op_aborted(true); } } } |