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

Side by Side Diff: chrome/browser/sessions/tab_restore_service.cc

Issue 10917026: Switch Extensions::TabHelper to use WebContents, WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase only Created 8 years, 3 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/sessions/tab_restore_service.h" 5 #include "chrome/browser/sessions/tab_restore_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <map> 9 #include <map>
10 10
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 tab->current_navigation_index = controller->GetCurrentEntryIndex(); 535 tab->current_navigation_index = controller->GetCurrentEntryIndex();
536 if (tab->current_navigation_index == -1 && entry_count > 0) 536 if (tab->current_navigation_index == -1 && entry_count > 0)
537 tab->current_navigation_index = 0; 537 tab->current_navigation_index = 0;
538 tab->tabstrip_index = index; 538 tab->tabstrip_index = index;
539 539
540 TabContents* tab_contents = 540 TabContents* tab_contents =
541 TabContents::FromWebContents(controller->GetWebContents()); 541 TabContents::FromWebContents(controller->GetWebContents());
542 // tab_contents is NULL in some browser tests. 542 // tab_contents is NULL in some browser tests.
543 if (tab_contents) { 543 if (tab_contents) {
544 const extensions::Extension* extension = 544 const extensions::Extension* extension =
545 tab_contents->extension_tab_helper()->extension_app(); 545 extensions::TabHelper::FromWebContents(controller->GetWebContents())->
546 extension_app();
546 if (extension) 547 if (extension)
547 tab->extension_app_id = extension->id(); 548 tab->extension_app_id = extension->id();
548 } 549 }
549 550
550 tab->user_agent_override = 551 tab->user_agent_override =
551 controller->GetWebContents()->GetUserAgentOverride(); 552 controller->GetWebContents()->GetUserAgentOverride();
552 553
553 // TODO(ajwong): This does not correctly handle storage for isolated apps. 554 // TODO(ajwong): This does not correctly handle storage for isolated apps.
554 tab->session_storage_namespace = 555 tab->session_storage_namespace =
555 controller->GetDefaultSessionStorageNamespace(); 556 controller->GetDefaultSessionStorageNamespace();
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 // the front, not the end and we just added the entries to the end). 1253 // the front, not the end and we just added the entries to the end).
1253 entries_to_write_ = staging_entries_.size(); 1254 entries_to_write_ = staging_entries_.size();
1254 1255
1255 PruneEntries(); 1256 PruneEntries();
1256 NotifyTabsChanged(); 1257 NotifyTabsChanged();
1257 } 1258 }
1258 1259
1259 Time TabRestoreService::TimeNow() const { 1260 Time TabRestoreService::TimeNow() const {
1260 return time_factory_ ? time_factory_->TimeNow() : Time::Now(); 1261 return time_factory_ ? time_factory_->TimeNow() : Time::Now();
1261 } 1262 }
OLDNEW
« no previous file with comments | « chrome/browser/sessions/session_service.cc ('k') | chrome/browser/sync/glue/session_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698