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

Side by Side Diff: content/browser/tab_contents/tab_contents.h

Issue 6526059: Plumb through NetworkChangeNotifier::IsOffline() to WebKit, enabling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No tests yet Created 9 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ 5 #ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_
6 #define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ 6 #define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_
7 #pragma once 7 #pragma once
8 8
9 #include <deque> 9 #include <deque>
10 #include <map> 10 #include <map>
(...skipping 17 matching lines...) Expand all
28 #include "chrome/common/renderer_preferences.h" 28 #include "chrome/common/renderer_preferences.h"
29 #include "chrome/common/translate_errors.h" 29 #include "chrome/common/translate_errors.h"
30 #include "chrome/common/web_apps.h" 30 #include "chrome/common/web_apps.h"
31 #include "content/browser/tab_contents/constrained_window.h" 31 #include "content/browser/tab_contents/constrained_window.h"
32 #include "content/browser/tab_contents/language_state.h" 32 #include "content/browser/tab_contents/language_state.h"
33 #include "content/browser/tab_contents/navigation_controller.h" 33 #include "content/browser/tab_contents/navigation_controller.h"
34 #include "content/browser/tab_contents/navigation_entry.h" 34 #include "content/browser/tab_contents/navigation_entry.h"
35 #include "content/browser/tab_contents/page_navigator.h" 35 #include "content/browser/tab_contents/page_navigator.h"
36 #include "content/browser/tab_contents/render_view_host_manager.h" 36 #include "content/browser/tab_contents/render_view_host_manager.h"
37 #include "net/base/load_states.h" 37 #include "net/base/load_states.h"
38 #include "net/base/network_change_notifier.h"
38 #include "ui/gfx/native_widget_types.h" 39 #include "ui/gfx/native_widget_types.h"
39 40
40 #if defined(OS_WIN) 41 #if defined(OS_WIN)
41 #include "base/win/scoped_handle.h" 42 #include "base/win/scoped_handle.h"
42 #endif 43 #endif
43 44
44 namespace gfx { 45 namespace gfx {
45 class Rect; 46 class Rect;
46 } 47 }
47 48
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 struct WebPreferences; 95 struct WebPreferences;
95 96
96 // Describes what goes in the main content area of a tab. TabContents is 97 // Describes what goes in the main content area of a tab. TabContents is
97 // the only type of TabContents, and these should be merged together. 98 // the only type of TabContents, and these should be merged together.
98 class TabContents : public PageNavigator, 99 class TabContents : public PageNavigator,
99 public NotificationObserver, 100 public NotificationObserver,
100 public RenderViewHostDelegate, 101 public RenderViewHostDelegate,
101 public RenderViewHostManager::Delegate, 102 public RenderViewHostManager::Delegate,
102 public JavaScriptAppModalDialogDelegate, 103 public JavaScriptAppModalDialogDelegate,
103 public ImageLoadingTracker::Observer, 104 public ImageLoadingTracker::Observer,
104 public TabSpecificContentSettings::Delegate { 105 public TabSpecificContentSettings::Delegate,
106 public net::NetworkChangeNotifier::OnlineStateObserver {
105 public: 107 public:
106 // Flags passed to the TabContentsDelegate.NavigationStateChanged to tell it 108 // Flags passed to the TabContentsDelegate.NavigationStateChanged to tell it
107 // what has changed. Combine them to update more than one thing. 109 // what has changed. Combine them to update more than one thing.
108 enum InvalidateTypes { 110 enum InvalidateTypes {
109 INVALIDATE_URL = 1 << 0, // The URL has changed. 111 INVALIDATE_URL = 1 << 0, // The URL has changed.
110 INVALIDATE_TAB = 1 << 1, // The favicon, app icon, or crashed 112 INVALIDATE_TAB = 1 << 1, // The favicon, app icon, or crashed
111 // state changed. 113 // state changed.
112 INVALIDATE_LOAD = 1 << 2, // The loading state has changed. 114 INVALIDATE_LOAD = 1 << 2, // The loading state has changed.
113 INVALIDATE_PAGE_ACTIONS = 1 << 3, // Page action icons have changed. 115 INVALIDATE_PAGE_ACTIONS = 1 << 3, // Page action icons have changed.
114 INVALIDATE_BOOKMARK_BAR = 1 << 4, // State of ShouldShowBookmarkBar 116 INVALIDATE_BOOKMARK_BAR = 1 << 4, // State of ShouldShowBookmarkBar
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 const Extension* GetExtensionContaining(const GURL& url); 1023 const Extension* GetExtensionContaining(const GURL& url);
1022 1024
1023 // Resets app_icon_ and if |extension| is non-null creates a new 1025 // Resets app_icon_ and if |extension| is non-null creates a new
1024 // ImageLoadingTracker to load the extension's image. 1026 // ImageLoadingTracker to load the extension's image.
1025 void UpdateExtensionAppIcon(const Extension* extension); 1027 void UpdateExtensionAppIcon(const Extension* extension);
1026 1028
1027 // ImageLoadingTracker::Observer. 1029 // ImageLoadingTracker::Observer.
1028 virtual void OnImageLoaded(SkBitmap* image, ExtensionResource resource, 1030 virtual void OnImageLoaded(SkBitmap* image, ExtensionResource resource,
1029 int index); 1031 int index);
1030 1032
1033 // NetworkChangeNotifier::OnlineStateObserver:
1034 virtual void OnOnlineStateChanged(bool online);
1035
1031 // Checks with the PrerenderManager if the specified URL has been preloaded, 1036 // Checks with the PrerenderManager if the specified URL has been preloaded,
1032 // and if so, swap the RenderViewHost with the preload into this TabContents 1037 // and if so, swap the RenderViewHost with the preload into this TabContents
1033 // object. 1038 // object.
1034 bool MaybeUsePreloadedPage(const GURL& url); 1039 bool MaybeUsePreloadedPage(const GURL& url);
1035 1040
1036 // Data for core operation --------------------------------------------------- 1041 // Data for core operation ---------------------------------------------------
1037 1042
1038 // Delegate for notifying our owner about stuff. Not owned by us. 1043 // Delegate for notifying our owner about stuff. Not owned by us.
1039 TabContentsDelegate* delegate_; 1044 TabContentsDelegate* delegate_;
1040 1045
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
1258 // (full-page plugins for now only) permissions. 1263 // (full-page plugins for now only) permissions.
1259 int content_restrictions_; 1264 int content_restrictions_;
1260 1265
1261 // Were the contents of this tab previously prerendered? 1266 // Were the contents of this tab previously prerendered?
1262 bool was_prerendered_; 1267 bool was_prerendered_;
1263 1268
1264 DISALLOW_COPY_AND_ASSIGN(TabContents); 1269 DISALLOW_COPY_AND_ASSIGN(TabContents);
1265 }; 1270 };
1266 1271
1267 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ 1272 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698