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

Unified Diff: chrome/browser/ui/tabs/pinned_tab_codec.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/tab_contents/tab_contents.cc ('k') | chrome/browser/ui/tabs/tab_strip_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/tabs/pinned_tab_codec.cc
diff --git a/chrome/browser/ui/tabs/pinned_tab_codec.cc b/chrome/browser/ui/tabs/pinned_tab_codec.cc
index 3ff361dc1152b3faaf52674bac125cb7c34b5182..458952131001116ae92b9cdf4270d59a6964c95e 100644
--- a/chrome/browser/ui/tabs/pinned_tab_codec.cc
+++ b/chrome/browser/ui/tabs/pinned_tab_codec.cc
@@ -52,22 +52,22 @@ static void EncodePinnedTab(TabStripModel* model,
ListValue* values) {
scoped_ptr<DictionaryValue> value(new DictionaryValue());
- TabContents* tab_contents = model->GetTabContentsAt(index);
+ content::WebContents* web_contents =
+ model->GetTabContentsAt(index)->web_contents();
if (model->IsAppTab(index)) {
const extensions::Extension* extension =
- tab_contents->extension_tab_helper()->extension_app();
+ extensions::TabHelper::FromWebContents(web_contents)->extension_app();
DCHECK(extension);
value->SetString(kAppID, extension->id());
- // For apps we use the launch url. We do this for the following reason:
- // . the user is effectively restarting the app, so that returning them to
- // the app's launch page seems closest to what they expect.
+ // For apps we use the launch url. We do this because the user is
+ // effectively restarting the app, so returning them to the app's launch
+ // page seems closest to what they expect.
value->SetString(kURL, extension->GetFullLaunchURL().spec());
values->Append(value.release());
} else {
- NavigationEntry* entry =
- tab_contents->web_contents()->GetController().GetActiveEntry();
- if (!entry && tab_contents->web_contents()->GetController().GetEntryCount())
- entry = tab_contents->web_contents()->GetController().GetEntryAtIndex(0);
+ NavigationEntry* entry = web_contents->GetController().GetActiveEntry();
+ if (!entry && web_contents->GetController().GetEntryCount())
+ entry = web_contents->GetController().GetEntryAtIndex(0);
if (entry) {
value->SetString(kURL, entry->GetURL().spec());
values->Append(value.release());
« no previous file with comments | « chrome/browser/ui/tab_contents/tab_contents.cc ('k') | chrome/browser/ui/tabs/tab_strip_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698