summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-06 05:16:50 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-06 05:16:50 +0000
commitc9cd22294bf1ef854e41c547d7c9f722b13593f6 (patch)
treef6fa6d01d068631718ef36f32470a22386bc6cec /chrome/browser/tab_contents
parent2ac844349bbe511cf17e597bfc3e8a0aaab9ceab (diff)
downloadchromium_src-c9cd22294bf1ef854e41c547d7c9f722b13593f6.zip
chromium_src-c9cd22294bf1ef854e41c547d7c9f722b13593f6.tar.gz
chromium_src-c9cd22294bf1ef854e41c547d7c9f722b13593f6.tar.bz2
Merge two TabContents::InvalidateTypes types and properly update tab download icon.
INVALIDATE_FAVICON and INVALIDATE_TITLE become INVALIDATE_TAB. Also removed some dead code. TEST=starting a download in a tab should show the download icon. Closing the dshelf should make the icon disappear. Review URL: http://codereview.chromium.org/109050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15387 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/interstitial_page.cc4
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc10
-rw-r--r--chrome/browser/tab_contents/tab_contents.h7
-rw-r--r--chrome/browser/tab_contents/tab_contents_delegate.h4
4 files changed, 9 insertions, 16 deletions
diff --git a/chrome/browser/tab_contents/interstitial_page.cc b/chrome/browser/tab_contents/interstitial_page.cc
index e0106aa..c913ce0 100644
--- a/chrome/browser/tab_contents/interstitial_page.cc
+++ b/chrome/browser/tab_contents/interstitial_page.cc
@@ -208,7 +208,7 @@ void InterstitialPage::Hide() {
NavigationEntry* entry = tab_->controller().GetActiveEntry();
if (!new_navigation_ && should_revert_tab_title_) {
entry->set_title(WideToUTF16Hack(original_tab_title_));
- tab_->NotifyNavigationStateChanged(TabContents::INVALIDATE_TITLE);
+ tab_->NotifyNavigationStateChanged(TabContents::INVALIDATE_TAB);
}
delete this;
}
@@ -402,7 +402,7 @@ void InterstitialPage::UpdateTitle(RenderViewHost* render_view_host,
should_revert_tab_title_ = true;
}
entry->set_title(WideToUTF16Hack(title));
- tab_->NotifyNavigationStateChanged(TabContents::INVALIDATE_TITLE);
+ tab_->NotifyNavigationStateChanged(TabContents::INVALIDATE_TAB);
}
RenderViewHostDelegate::View* InterstitialPage::GetViewDelegate() const {
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index d673f43..83c49c6 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -580,8 +580,7 @@ void TabContents::SetIsCrashed(bool state) {
return;
is_crashed_ = state;
- if (delegate_)
- delegate_->ContentsStateChanged(this);
+ NotifyNavigationStateChanged(INVALIDATE_TAB);
}
void TabContents::NotifyNavigationStateChanged(unsigned changed_flags) {
@@ -932,8 +931,7 @@ void TabContents::SetDownloadShelfVisible(bool visible) {
}
shelf_visible_ = visible;
- if (delegate_)
- delegate_->ContentsStateChanged(this);
+ NotifyNavigationStateChanged(INVALIDATE_TAB);
}
// SetShelfVisible can force-close the shelf, so make sure we lay out
@@ -1724,7 +1722,7 @@ void TabContents::UpdateTitle(RenderViewHost* rvh,
// Broadcast notifications when the UI should be updated.
if (entry == controller_.GetEntryAtOffset(0))
- NotifyNavigationStateChanged(INVALIDATE_TITLE);
+ NotifyNavigationStateChanged(INVALIDATE_TAB);
}
void TabContents::UpdateEncoding(RenderViewHost* render_view_host,
@@ -2257,7 +2255,7 @@ void TabContents::LoadStateChanged(const GURL& url,
if (load_state_ == net::LOAD_STATE_READING_RESPONSE)
SetNotWaitingForResponse();
if (is_loading())
- NotifyNavigationStateChanged(INVALIDATE_LOAD | INVALIDATE_FAVICON);
+ NotifyNavigationStateChanged(INVALIDATE_LOAD | INVALIDATE_TAB);
}
void TabContents::OnDidGetApplicationInfo(
diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h
index cb7e589..1a83d8c 100644
--- a/chrome/browser/tab_contents/tab_contents.h
+++ b/chrome/browser/tab_contents/tab_contents.h
@@ -93,10 +93,9 @@ class TabContents : public PageNavigator,
// what has changed. Combine them to update more than one thing.
enum InvalidateTypes {
INVALIDATE_URL = 1, // The URL has changed.
- INVALIDATE_TITLE = 2, // The title has changed.
- INVALIDATE_FAVICON = 4, // The favicon has changed.
- INVALIDATE_LOAD = 8, // The loading state has changed.
- INVALIDATE_PAGE_ACTIONS = 16, // Page action icons have changed.
+ INVALIDATE_TAB = 2, // The tab (favicon, title, etc.) has changed
+ INVALIDATE_LOAD = 4, // The loading state has changed.
+ INVALIDATE_PAGE_ACTIONS = 8, // Page action icons have changed.
// Helper for forcing a refresh.
INVALIDATE_EVERYTHING = 0xFFFFFFFF
};
diff --git a/chrome/browser/tab_contents/tab_contents_delegate.h b/chrome/browser/tab_contents/tab_contents_delegate.h
index 6eff8d26..ad7ac1e 100644
--- a/chrome/browser/tab_contents/tab_contents_delegate.h
+++ b/chrome/browser/tab_contents/tab_contents_delegate.h
@@ -97,10 +97,6 @@ class TabContentsDelegate {
// a TabContents with a valid WebApp set.
virtual void ConvertContentsToApplication(TabContents* source) { }
- // Informs the TabContentsDelegate that some of our state has changed
- // for this tab.
- virtual void ContentsStateChanged(TabContents* source) {}
-
// Return whether this tab contents should have a URL bar. Only web contents
// opened with a minimal chrome and their popups can be displayed without a
// URL bar.