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

Unified Diff: chrome/browser/task_manager/tab_contents_resource_provider.cc

Issue 18223002: InstantExtended: Remove overlay control code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Call renamed method. Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/task_manager/tab_contents_resource_provider.cc
diff --git a/chrome/browser/task_manager/tab_contents_resource_provider.cc b/chrome/browser/task_manager/tab_contents_resource_provider.cc
index 6b185ff8257a72fd28f49ebe342a56d32d8e49fc..de3a008c7c6cc6d23700937e4611aad4fb940236 100644
--- a/chrome/browser/task_manager/tab_contents_resource_provider.cc
+++ b/chrome/browser/task_manager/tab_contents_resource_provider.cc
@@ -64,10 +64,6 @@ class TabContentsResource : public RendererResource {
explicit TabContentsResource(content::WebContents* web_contents);
virtual ~TabContentsResource();
- // Called when the underlying web_contents has been committed and is no
- // longer an Instant overlay.
- void InstantCommitted();
-
// Resource methods:
virtual Type GetType() const OVERRIDE;
virtual string16 GetTitle() const OVERRIDE;
@@ -83,7 +79,7 @@ class TabContentsResource : public RendererResource {
static gfx::ImageSkia* prerender_icon_;
content::WebContents* web_contents_;
Profile* profile_;
- bool is_instant_overlay_;
+ bool is_instant_ntp_;
DISALLOW_COPY_AND_ASSIGN(TabContentsResource);
};
@@ -96,8 +92,7 @@ TabContentsResource::TabContentsResource(
web_contents->GetRenderViewHost()),
web_contents_(web_contents),
profile_(Profile::FromBrowserContext(web_contents->GetBrowserContext())),
- is_instant_overlay_(chrome::IsInstantOverlay(web_contents) ||
- chrome::IsPreloadedInstantExtendedNTP(web_contents)) {
+ is_instant_ntp_(chrome::IsPreloadedInstantExtendedNTP(web_contents)) {
if (!prerender_icon_) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
prerender_icon_ = rb.GetImageSkiaNamed(IDR_PRERENDER);
@@ -107,11 +102,6 @@ TabContentsResource::TabContentsResource(
TabContentsResource::~TabContentsResource() {
}
-void TabContentsResource::InstantCommitted() {
- DCHECK(is_instant_overlay_);
- is_instant_overlay_ = false;
-}
-
bool TabContentsResource::HostsExtension() const {
return web_contents_->GetURL().SchemeIs(extensions::kExtensionScheme);
}
@@ -138,7 +128,7 @@ string16 TabContentsResource::GetTitle() const {
HostsExtension(),
profile_->IsOffTheRecord(),
IsContentsPrerendering(web_contents_),
- is_instant_overlay_,
+ is_instant_ntp_,
false); // is_background
return l10n_util::GetStringFUTF16(message_id, tab_title);
}
@@ -220,8 +210,6 @@ void TabContentsResourceProvider::StartUpdating() {
// Add all the Instant pages.
for (chrome::BrowserIterator it; !it.done(); it.Next()) {
if (it->instant_controller()) {
- if (it->instant_controller()->instant()->GetOverlayContents())
- Add(it->instant_controller()->instant()->GetOverlayContents());
if (it->instant_controller()->instant()->GetNTPContents())
Add(it->instant_controller()->instant()->GetNTPContents());
}
@@ -257,8 +245,6 @@ void TabContentsResourceProvider::StartUpdating() {
content::NotificationService::AllBrowserContextsAndSources());
registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED,
content::NotificationService::AllBrowserContextsAndSources());
- registrar_.Add(this, chrome::NOTIFICATION_INSTANT_COMMITTED,
- content::NotificationService::AllBrowserContextsAndSources());
}
void TabContentsResourceProvider::StopUpdating() {
@@ -272,8 +258,6 @@ void TabContentsResourceProvider::StopUpdating() {
content::NotificationService::AllBrowserContextsAndSources());
registrar_.Remove(this, content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED,
content::NotificationService::AllBrowserContextsAndSources());
- registrar_.Remove(this, chrome::NOTIFICATION_INSTANT_COMMITTED,
- content::NotificationService::AllBrowserContextsAndSources());
// Delete all the resources.
STLDeleteContainerPairSecondPointers(resources_.begin(), resources_.end());
@@ -296,7 +280,6 @@ void TabContentsResourceProvider::Add(WebContents* web_contents) {
// pages, prerender pages, and background printed pages.
if (!chrome::FindBrowserWithWebContents(web_contents) &&
!IsContentsPrerendering(web_contents) &&
- !chrome::IsInstantOverlay(web_contents) &&
!chrome::IsPreloadedInstantExtendedNTP(web_contents) &&
!IsContentsBackgroundPrinted(web_contents)) {
return;
@@ -340,16 +323,6 @@ void TabContentsResourceProvider::Remove(WebContents* web_contents) {
delete resource;
}
-void TabContentsResourceProvider::InstantCommitted(WebContents* web_contents) {
- if (!updating_)
- return;
- std::map<WebContents*, TabContentsResource*>::iterator
- iter = resources_.find(web_contents);
- DCHECK(iter != resources_.end());
- if (iter != resources_.end())
- iter->second->InstantCommitted();
-}
-
void TabContentsResourceProvider::Observe(
int type,
const content::NotificationSource& source,
@@ -367,9 +340,6 @@ void TabContentsResourceProvider::Observe(
case content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED:
Remove(web_contents);
break;
- case chrome::NOTIFICATION_INSTANT_COMMITTED:
- InstantCommitted(web_contents);
- break;
default:
NOTREACHED() << "Unexpected notification.";
return;
« no previous file with comments | « chrome/browser/task_manager/tab_contents_resource_provider.h ('k') | chrome/browser/ui/browser_instant_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698