diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-09 05:57:22 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-09 05:57:22 +0000 |
commit | a6b3f73ba9b06535198a36f71ba5ea3cacd45e4b (patch) | |
tree | aff14868d34ce5673489b2444e7e36737f597598 | |
parent | 6522338e3e58e9afc565fe69268ffd77a26dc0d5 (diff) | |
download | chromium_src-a6b3f73ba9b06535198a36f71ba5ea3cacd45e4b.zip chromium_src-a6b3f73ba9b06535198a36f71ba5ea3cacd45e4b.tar.gz chromium_src-a6b3f73ba9b06535198a36f71ba5ea3cacd45e4b.tar.bz2 |
Use InvalidateTypes rather than "unsigned".
BUG=none
TEST=no change
Review URL: https://codereview.chromium.org/450283005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288521 0039d316-1c4b-4281-b951-d872f2087c98
23 files changed, 52 insertions, 39 deletions
diff --git a/apps/app_window.cc b/apps/app_window.cc index e13e1b0..718476a 100644 --- a/apps/app_window.cc +++ b/apps/app_window.cc @@ -923,7 +923,7 @@ void AppWindow::MoveContents(WebContents* source, const gfx::Rect& pos) { } void AppWindow::NavigationStateChanged(const content::WebContents* source, - unsigned changed_flags) { + content::InvalidateTypes changed_flags) { if (changed_flags & content::INVALIDATE_TYPE_TITLE) native_app_window_->UpdateWindowTitle(); else if (changed_flags & content::INVALIDATE_TYPE_TAB) diff --git a/apps/app_window.h b/apps/app_window.h index ba3b448..c226265 100644 --- a/apps/app_window.h +++ b/apps/app_window.h @@ -370,8 +370,9 @@ class AppWindow : public content::NotificationObserver, const OVERRIDE; virtual void MoveContents(content::WebContents* source, const gfx::Rect& pos) OVERRIDE; - virtual void NavigationStateChanged(const content::WebContents* source, - unsigned changed_flags) OVERRIDE; + virtual void NavigationStateChanged( + const content::WebContents* source, + content::InvalidateTypes changed_flags) OVERRIDE; virtual void ToggleFullscreenModeForTab(content::WebContents* source, bool enter_fullscreen) OVERRIDE; virtual bool IsFullscreenForTabOrPending(const content::WebContents* source) diff --git a/chrome/browser/chromeos/login/ui/captive_portal_view.cc b/chrome/browser/chromeos/login/ui/captive_portal_view.cc index 23f6e2e..16ba24d 100644 --- a/chrome/browser/chromeos/login/ui/captive_portal_view.cc +++ b/chrome/browser/chromeos/login/ui/captive_portal_view.cc @@ -75,7 +75,8 @@ views::NonClientFrameView* CaptivePortalView::CreateNonClientFrameView( } void CaptivePortalView::NavigationStateChanged( - const content::WebContents* source, unsigned changed_flags) { + const content::WebContents* source, + content::InvalidateTypes changed_flags) { SimpleWebViewDialog::NavigationStateChanged(source, changed_flags); // Naive way to determine the redirection. This won't be needed after portal diff --git a/chrome/browser/chromeos/login/ui/captive_portal_view.h b/chrome/browser/chromeos/login/ui/captive_portal_view.h index 2a0bde6..2bc4268 100644 --- a/chrome/browser/chromeos/login/ui/captive_portal_view.h +++ b/chrome/browser/chromeos/login/ui/captive_portal_view.h @@ -29,8 +29,9 @@ class CaptivePortalView : public SimpleWebViewDialog { views::Widget* widget) OVERRIDE; // Overridden from content::WebContentsDelegate: - virtual void NavigationStateChanged(const content::WebContents* source, - unsigned changed_flags) OVERRIDE; + virtual void NavigationStateChanged( + const content::WebContents* source, + content::InvalidateTypes changed_flags) OVERRIDE; virtual void LoadingStateChanged(content::WebContents* source, bool to_different_document) OVERRIDE; diff --git a/chrome/browser/chromeos/login/ui/simple_web_view_dialog.cc b/chrome/browser/chromeos/login/ui/simple_web_view_dialog.cc index c9e1a84..61b72c3 100644 --- a/chrome/browser/chromeos/login/ui/simple_web_view_dialog.cc +++ b/chrome/browser/chromeos/login/ui/simple_web_view_dialog.cc @@ -263,7 +263,7 @@ content::WebContents* SimpleWebViewDialog::OpenURL( } void SimpleWebViewDialog::NavigationStateChanged( - const WebContents* source, unsigned changed_flags) { + const WebContents* source, content::InvalidateTypes changed_flags) { if (location_bar_) { location_bar_->Update(NULL); UpdateButtons(); diff --git a/chrome/browser/chromeos/login/ui/simple_web_view_dialog.h b/chrome/browser/chromeos/login/ui/simple_web_view_dialog.h index ecd6aa5..566e19e 100644 --- a/chrome/browser/chromeos/login/ui/simple_web_view_dialog.h +++ b/chrome/browser/chromeos/login/ui/simple_web_view_dialog.h @@ -68,8 +68,9 @@ class SimpleWebViewDialog : public views::ButtonListener, const content::OpenURLParams& params) OVERRIDE; // Implements content::WebContentsDelegate: - virtual void NavigationStateChanged(const content::WebContents* source, - unsigned changed_flags) OVERRIDE; + virtual void NavigationStateChanged( + const content::WebContents* source, + content::InvalidateTypes changed_flags) OVERRIDE; virtual void LoadingStateChanged(content::WebContents* source, bool to_different_document) OVERRIDE; diff --git a/chrome/browser/media/audio_stream_monitor_unittest.cc b/chrome/browser/media/audio_stream_monitor_unittest.cc index 51ac58f..58c4adb 100644 --- a/chrome/browser/media/audio_stream_monitor_unittest.cc +++ b/chrome/browser/media/audio_stream_monitor_unittest.cc @@ -32,7 +32,7 @@ class MockWebContentsDelegate : public content::WebContentsDelegate { public: MOCK_METHOD2(NavigationStateChanged, void(const content::WebContents* source, - unsigned changed_flags)); + content::InvalidateTypes changed_flags)); }; } // namespace diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index ac3ae9c..114ed52 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -1347,7 +1347,7 @@ WebContents* Browser::OpenURLFromTab(WebContents* source, } void Browser::NavigationStateChanged(const WebContents* source, - unsigned changed_flags) { + content::InvalidateTypes changed_flags) { // Only update the UI when something visible has changed. if (changed_flags) ScheduleUIUpdate(source, changed_flags); diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h index cba3953..ab4abcc 100644 --- a/chrome/browser/ui/browser.h +++ b/chrome/browser/ui/browser.h @@ -540,8 +540,9 @@ class Browser : public TabStripModelObserver, virtual content::WebContents* OpenURLFromTab( content::WebContents* source, const content::OpenURLParams& params) OVERRIDE; - virtual void NavigationStateChanged(const content::WebContents* source, - unsigned changed_flags) OVERRIDE; + virtual void NavigationStateChanged( + const content::WebContents* source, + content::InvalidateTypes changed_flags) OVERRIDE; virtual void VisibleSSLStateChanged( const content::WebContents* source) OVERRIDE; virtual void AddNewContents(content::WebContents* source, diff --git a/chrome/browser/ui/panels/panel_host.cc b/chrome/browser/ui/panels/panel_host.cc index 907b11a..ed6b629 100644 --- a/chrome/browser/ui/panels/panel_host.cc +++ b/chrome/browser/ui/panels/panel_host.cc @@ -126,7 +126,7 @@ content::WebContents* PanelHost::OpenURLFromTab( } void PanelHost::NavigationStateChanged(const content::WebContents* source, - unsigned changed_flags) { + content::InvalidateTypes changed_flags) { // Only need to update the title if the title changed while not loading, // because the title is also updated when loading state changes. if ((changed_flags & content::INVALIDATE_TYPE_TAB) || diff --git a/chrome/browser/ui/panels/panel_host.h b/chrome/browser/ui/panels/panel_host.h index 3277c3b..d622c23 100644 --- a/chrome/browser/ui/panels/panel_host.h +++ b/chrome/browser/ui/panels/panel_host.h @@ -51,8 +51,9 @@ class PanelHost : public content::WebContentsDelegate, virtual content::WebContents* OpenURLFromTab( content::WebContents* source, const content::OpenURLParams& params) OVERRIDE; - virtual void NavigationStateChanged(const content::WebContents* source, - unsigned changed_flags) OVERRIDE; + virtual void NavigationStateChanged( + const content::WebContents* source, + content::InvalidateTypes changed_flags) OVERRIDE; virtual void AddNewContents(content::WebContents* source, content::WebContents* new_contents, WindowOpenDisposition disposition, diff --git a/chrome/browser/ui/views/frame/browser_view_browsertest.cc b/chrome/browser/ui/views/frame/browser_view_browsertest.cc index 2abe93e..d10c90c 100644 --- a/chrome/browser/ui/views/frame/browser_view_browsertest.cc +++ b/chrome/browser/ui/views/frame/browser_view_browsertest.cc @@ -62,8 +62,8 @@ class TestWebContentsObserver : public content::WebContentsObserver { virtual ~TestWebContentsObserver() {} virtual void WebContentsDestroyed() OVERRIDE { - other_->NotifyNavigationStateChanged( - content::INVALIDATE_TYPE_URL | content::INVALIDATE_TYPE_LOAD); + other_->NotifyNavigationStateChanged(static_cast<content::InvalidateTypes>( + content::INVALIDATE_TYPE_URL | content::INVALIDATE_TYPE_LOAD)); } private: diff --git a/chrome/browser/ui/webui/web_dialog_web_contents_delegate_unittest.cc b/chrome/browser/ui/webui/web_dialog_web_contents_delegate_unittest.cc index 10d8257..ac28b7d 100644 --- a/chrome/browser/ui/webui/web_dialog_web_contents_delegate_unittest.cc +++ b/chrome/browser/ui/webui/web_dialog_web_contents_delegate_unittest.cc @@ -65,9 +65,10 @@ TEST_F(WebDialogWebContentsDelegateTest, DoNothingMethodsTest) { // None of the following calls should do anything. EXPECT_TRUE(test_web_contents_delegate_->IsPopupOrPanel(NULL)); history::HistoryAddPageArgs should_add_args( - GURL(), base::Time::Now(), 0, 0, GURL(), history::RedirectList(), - content::PAGE_TRANSITION_TYPED, history::SOURCE_SYNCED, false); - test_web_contents_delegate_->NavigationStateChanged(NULL, 0); + GURL(), base::Time::Now(), 0, 0, GURL(), history::RedirectList(), + content::PAGE_TRANSITION_TYPED, history::SOURCE_SYNCED, false); + test_web_contents_delegate_->NavigationStateChanged( + NULL, content::InvalidateTypes(0)); test_web_contents_delegate_->ActivateContents(NULL); test_web_contents_delegate_->LoadingStateChanged(NULL, true); test_web_contents_delegate_->CloseContents(NULL); diff --git a/components/web_contents_delegate_android/web_contents_delegate_android.cc b/components/web_contents_delegate_android/web_contents_delegate_android.cc index 525e5ba..9e6e15e 100644 --- a/components/web_contents_delegate_android/web_contents_delegate_android.cc +++ b/components/web_contents_delegate_android/web_contents_delegate_android.cc @@ -140,7 +140,7 @@ WebContents* WebContentsDelegateAndroid::OpenURLFromTab( } void WebContentsDelegateAndroid::NavigationStateChanged( - const WebContents* source, unsigned changed_flags) { + const WebContents* source, content::InvalidateTypes changed_flags) { JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); if (obj.is_null()) diff --git a/components/web_contents_delegate_android/web_contents_delegate_android.h b/components/web_contents_delegate_android/web_contents_delegate_android.h index b61eba4..33a4618 100644 --- a/components/web_contents_delegate_android/web_contents_delegate_android.h +++ b/components/web_contents_delegate_android/web_contents_delegate_android.h @@ -58,8 +58,9 @@ class WebContentsDelegateAndroid : public content::WebContentsDelegate { content::WebContents* source, SkColor color, const std::vector<content::ColorSuggestion>& suggestions) OVERRIDE; - virtual void NavigationStateChanged(const content::WebContents* source, - unsigned changed_flags) OVERRIDE; + virtual void NavigationStateChanged( + const content::WebContents* source, + content::InvalidateTypes changed_flags) OVERRIDE; virtual void VisibleSSLStateChanged( const content::WebContents* source) OVERRIDE; virtual void ActivateContents(content::WebContents* contents) OVERRIDE; diff --git a/content/browser/frame_host/navigation_controller_delegate.h b/content/browser/frame_host/navigation_controller_delegate.h index 49dfc60..52567ef 100644 --- a/content/browser/frame_host/navigation_controller_delegate.h +++ b/content/browser/frame_host/navigation_controller_delegate.h @@ -6,6 +6,7 @@ #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_DELEGATE_H_ #include <string> +#include "content/public/browser/invalidate_type.h" #include "content/public/browser/navigation_controller.h" #include "content/public/browser/navigation_details.h" @@ -34,7 +35,7 @@ class NavigationControllerDelegate { virtual RenderViewHost* GetRenderViewHost() const = 0; virtual InterstitialPage* GetInterstitialPage() const = 0; virtual const std::string& GetContentsMimeType() const = 0; - virtual void NotifyNavigationStateChanged(unsigned changed_flags) = 0; + virtual void NotifyNavigationStateChanged(InvalidateTypes changed_flags) = 0; virtual void Stop() = 0; virtual SiteInstance* GetPendingSiteInstance() const = 0; virtual int32 GetMaxPageID() = 0; diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc index 3997cae..dc2b4ac 100644 --- a/content/browser/frame_host/navigation_controller_impl.cc +++ b/content/browser/frame_host/navigation_controller_impl.cc @@ -46,8 +46,6 @@ namespace content { namespace { -const unsigned kInvalidateAll = 0xFFFFFFFF; - // Invoked when entries have been pruned, or removed. For example, if the // current entries are [google, digg, yahoo], with the current entry google, // and the user types in cnet, then digg and yahoo are pruned. @@ -1525,7 +1523,7 @@ void NavigationControllerImpl::DiscardNonCommittedEntries() { // If there was a transient entry, invalidate everything so the new active // entry state is shown. if (transient) { - delegate_->NotifyNavigationStateChanged(kInvalidateAll); + delegate_->NotifyNavigationStateChanged(INVALIDATE_TYPE_ALL); } } @@ -1659,7 +1657,7 @@ void NavigationControllerImpl::NotifyNavigationEntryCommitted( // when it wants to draw. See http://crbug.com/11157 ssl_manager_.DidCommitProvisionalLoad(*details); - delegate_->NotifyNavigationStateChanged(kInvalidateAll); + delegate_->NotifyNavigationStateChanged(INVALIDATE_TYPE_ALL); delegate_->NotifyNavigationEntryCommitted(*details); // TODO(avi): Remove. http://crbug.com/170921 @@ -1768,7 +1766,7 @@ void NavigationControllerImpl::SetTransientEntry(NavigationEntry* entry) { entries_.begin() + index, linked_ptr<NavigationEntryImpl>( NavigationEntryImpl::FromNavigationEntry(entry))); transient_entry_index_ = index; - delegate_->NotifyNavigationStateChanged(kInvalidateAll); + delegate_->NotifyNavigationStateChanged(INVALIDATE_TYPE_ALL); } void NavigationControllerImpl::InsertEntriesFrom( diff --git a/content/browser/frame_host/navigation_controller_impl_unittest.cc b/content/browser/frame_host/navigation_controller_impl_unittest.cc index 119c112..442595e 100644 --- a/content/browser/frame_host/navigation_controller_impl_unittest.cc +++ b/content/browser/frame_host/navigation_controller_impl_unittest.cc @@ -246,7 +246,7 @@ class TestWebContentsDelegate : public WebContentsDelegate { // Keep track of whether the tab has notified us of a navigation state change. virtual void NavigationStateChanged(const WebContents* source, - unsigned changed_flags) OVERRIDE { + InvalidateTypes changed_flags) OVERRIDE { navigation_state_change_count_++; } diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index 6039e32..f644ee9 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -1009,7 +1009,8 @@ bool WebContentsImpl::IsBeingDestroyed() const { return is_being_destroyed_; } -void WebContentsImpl::NotifyNavigationStateChanged(unsigned changed_flags) { +void WebContentsImpl::NotifyNavigationStateChanged( + InvalidateTypes changed_flags) { if (delegate_) delegate_->NavigationStateChanged(this, changed_flags); } @@ -3918,7 +3919,8 @@ void WebContentsImpl::LoadStateChanged( if (load_state_.state == net::LOAD_STATE_READING_RESPONSE) SetNotWaitingForResponse(); if (IsLoading()) { - NotifyNavigationStateChanged(INVALIDATE_TYPE_LOAD | INVALIDATE_TYPE_TAB); + NotifyNavigationStateChanged(static_cast<InvalidateTypes>( + INVALIDATE_TYPE_LOAD | INVALIDATE_TYPE_TAB)); } } diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h index 05698e2..f53a644 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h @@ -245,7 +245,8 @@ class CONTENT_EXPORT WebContentsImpl int error_code) OVERRIDE; virtual base::TerminationStatus GetCrashedStatus() const OVERRIDE; virtual bool IsBeingDestroyed() const OVERRIDE; - virtual void NotifyNavigationStateChanged(unsigned changed_flags) OVERRIDE; + virtual void NotifyNavigationStateChanged( + InvalidateTypes changed_flags) OVERRIDE; virtual base::TimeTicks GetLastActiveTime() const OVERRIDE; virtual void WasShown() OVERRIDE; virtual void WasHidden() OVERRIDE; diff --git a/content/public/browser/invalidate_type.h b/content/public/browser/invalidate_type.h index e352e01..9eec214 100644 --- a/content/public/browser/invalidate_type.h +++ b/content/public/browser/invalidate_type.h @@ -16,6 +16,8 @@ enum InvalidateTypes { INVALIDATE_TYPE_LOAD = 1 << 2, // The loading state has changed. INVALIDATE_TYPE_PAGE_ACTIONS = 1 << 3, // Page action icons have changed. INVALIDATE_TYPE_TITLE = 1 << 4, // The title changed. + + INVALIDATE_TYPE_ALL = (1 << 5) - 1, }; } diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h index b163306..917a3af 100644 --- a/content/public/browser/web_contents.h +++ b/content/public/browser/web_contents.h @@ -14,6 +14,7 @@ #include "base/strings/string16.h" #include "base/supports_user_data.h" #include "content/common/content_export.h" +#include "content/public/browser/invalidate_type.h" #include "content/public/browser/navigation_controller.h" #include "content/public/browser/page_navigator.h" #include "content/public/browser/save_page_type.h" @@ -315,8 +316,8 @@ class WebContents : public PageNavigator, virtual bool IsBeingDestroyed() const = 0; // Convenience method for notifying the delegate of a navigation state - // change. See InvalidateType enum. - virtual void NotifyNavigationStateChanged(unsigned changed_flags) = 0; + // change. + virtual void NotifyNavigationStateChanged(InvalidateTypes changed_flags) = 0; // Get the last time that the WebContents was made active (either when it was // created or shown with WasShown()). diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h index 96133e2..b9aa02d 100644 --- a/content/public/browser/web_contents_delegate.h +++ b/content/public/browser/web_contents_delegate.h @@ -12,6 +12,7 @@ #include "base/callback.h" #include "base/strings/string16.h" #include "content/common/content_export.h" +#include "content/public/browser/invalidate_type.h" #include "content/public/browser/navigation_type.h" #include "content/public/common/media_stream_request.h" #include "content/public/common/page_transition_types.h" @@ -84,10 +85,9 @@ class CONTENT_EXPORT WebContentsDelegate { // Called to inform the delegate that the WebContents's navigation state // changed. The |changed_flags| indicates the parts of the navigation state - // that have been updated, and is any combination of the - // |WebContents::InvalidateTypes| bits. + // that have been updated. virtual void NavigationStateChanged(const WebContents* source, - unsigned changed_flags) {} + InvalidateTypes changed_flags) {} // Called to inform the delegate that the WebContent's visible SSL state (as // defined by SSLStatus) changed. |