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

Side by Side Diff: chrome/browser/extensions/extension_tabs_module.cc

Issue 6369003: New extension API: "tab.socketAddress" (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 11 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/extensions/extension_tabs_module.h" 5 #include "chrome/browser/extensions/extension_tabs_module.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 tab_strip && tab_strip->IsTabPinned(tab_index)); 130 tab_strip && tab_strip->IsTabPinned(tab_index));
131 result->SetString(keys::kTitleKey, contents->GetTitle()); 131 result->SetString(keys::kTitleKey, contents->GetTitle());
132 result->SetBoolean(keys::kIncognitoKey, 132 result->SetBoolean(keys::kIncognitoKey,
133 contents->profile()->IsOffTheRecord()); 133 contents->profile()->IsOffTheRecord());
134 134
135 if (!contents->is_loading()) { 135 if (!contents->is_loading()) {
136 NavigationEntry* entry = contents->controller().GetActiveEntry(); 136 NavigationEntry* entry = contents->controller().GetActiveEntry();
137 if (entry) { 137 if (entry) {
138 if (entry->favicon().is_valid()) 138 if (entry->favicon().is_valid())
139 result->SetString(keys::kFavIconUrlKey, entry->favicon().url().spec()); 139 result->SetString(keys::kFavIconUrlKey, entry->favicon().url().spec());
140 if (!entry->socket_address().empty())
141 result->SetString(keys::kSocketAddressKey, entry->socket_address());
140 } 142 }
141 } 143 }
142 144
143 return result; 145 return result;
144 } 146 }
145 147
146 // if |populate| is true, each window gets a list property |tabs| which contains 148 // if |populate| is true, each window gets a list property |tabs| which contains
147 // fully populated tab objects. 149 // fully populated tab objects.
148 DictionaryValue* ExtensionTabUtil::CreateWindowValue(const Browser* browser, 150 DictionaryValue* ExtensionTabUtil::CreateWindowValue(const Browser* browser,
149 bool populate_tabs) { 151 bool populate_tabs) {
(...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after
1238 } 1240 }
1239 1241
1240 static GURL ResolvePossiblyRelativeURL(std::string url_string, 1242 static GURL ResolvePossiblyRelativeURL(std::string url_string,
1241 const Extension* extension) { 1243 const Extension* extension) {
1242 GURL url = GURL(url_string); 1244 GURL url = GURL(url_string);
1243 if (!url.is_valid()) 1245 if (!url.is_valid())
1244 url = extension->GetResourceURL(url_string); 1246 url = extension->GetResourceURL(url_string);
1245 1247
1246 return url; 1248 return url;
1247 } 1249 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698