summaryrefslogtreecommitdiffstats
path: root/content/browser/tab_contents/tab_contents.h
diff options
context:
space:
mode:
authoradamk@google.com <adamk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-02 00:01:58 +0000
committeradamk@google.com <adamk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-02 00:01:58 +0000
commitf1c244e1c3d0fc1b44cc3044c1c49b4fe799eb0c (patch)
tree8472a6b1cadfe2ed1cac8b786c63cf494785633d /content/browser/tab_contents/tab_contents.h
parentcadea3888ab685b6e88589d008b9537e67a6d256 (diff)
downloadchromium_src-f1c244e1c3d0fc1b44cc3044c1c49b4fe799eb0c.zip
chromium_src-f1c244e1c3d0fc1b44cc3044c1c49b4fe799eb0c.tar.gz
chromium_src-f1c244e1c3d0fc1b44cc3044c1c49b4fe799eb0c.tar.bz2
Revert 91390 (build breakage) - Convert ViewMsg_NetworkStateChanged from routed -> control
allowing it to be sent from BrowserRenderProcessHost::OnProcessLaunched and minimizing the number of required IPCs (since the online state is a per-WebKit singleton). In doing so, I've disentangled online state management from TabContents: it now resides off by itself in BrowserOnlineStateObserver, a tiny class owned by BrowserProcessImpl. BUG=7469,86538 TEST=begin with network disconnected, open new tab, load test page attached to 7469, then re-connect network Review URL: http://codereview.chromium.org/7259004 TBR=eroman@chromium.org Review URL: http://codereview.chromium.org/7300018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91392 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/tab_contents/tab_contents.h')
-rw-r--r--content/browser/tab_contents/tab_contents.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/content/browser/tab_contents/tab_contents.h b/content/browser/tab_contents/tab_contents.h
index dfde09a..458d341 100644
--- a/content/browser/tab_contents/tab_contents.h
+++ b/content/browser/tab_contents/tab_contents.h
@@ -13,7 +13,6 @@
#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
-#include "base/observer_list.h"
#include "base/string16.h"
#include "content/browser/javascript_dialogs.h"
#include "content/browser/renderer_host/render_view_host_delegate.h"
@@ -28,6 +27,7 @@
#include "content/common/property_bag.h"
#include "content/common/renderer_preferences.h"
#include "net/base/load_states.h"
+#include "net/base/network_change_notifier.h"
#include "ui/gfx/native_widget_types.h"
#if defined(OS_WIN)
@@ -61,7 +61,8 @@ class TabContents : public PageNavigator,
public NotificationObserver,
public RenderViewHostDelegate,
public RenderViewHostManager::Delegate,
- public content::JavaScriptDialogDelegate {
+ public content::JavaScriptDialogDelegate,
+ public net::NetworkChangeNotifier::OnlineStateObserver {
public:
// Flags passed to the TabContentsDelegate.NavigationStateChanged to tell it
// what has changed. Combine them to update more than one thing.
@@ -514,6 +515,9 @@ class TabContents : public PageNavigator,
// TODO(brettw) TestTabContents shouldn't exist!
friend class TestTabContents;
+ // Add all the TabContentObservers.
+ void AddObservers();
+
// Message handlers.
void OnDidStartProvisionalLoadForFrame(int64 frame_id,
bool main_frame,
@@ -700,6 +704,9 @@ class TabContents : public PageNavigator,
const NotificationSource& source,
const NotificationDetails& details);
+ // NetworkChangeNotifier::OnlineStateObserver:
+ virtual void OnOnlineStateChanged(bool online);
+
// Adds the given window to the list of child windows. The window will notify
// via WillClose() when it is being destroyed.
void AddConstrainedDialog(ConstrainedWindow* window);