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

Unified Diff: chrome/browser/extensions/extension_tab_util.cc

Issue 23108007: Add width and height to chrome.tabs.Tab. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code formatting. Check width and height is positive for newly created tab. Created 7 years, 4 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 | « no previous file | chrome/browser/extensions/extension_tabs_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_tab_util.cc
diff --git a/chrome/browser/extensions/extension_tab_util.cc b/chrome/browser/extensions/extension_tab_util.cc
index b5d5ab9951e693c89d0aa285fe9f3bb04c2f4e3b..391065998dcff938998d83c995b33bd08c0eed7c 100644
--- a/chrome/browser/extensions/extension_tab_util.cc
+++ b/chrome/browser/extensions/extension_tab_util.cc
@@ -28,6 +28,7 @@
#include "content/public/browser/favicon_status.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_contents_view.h"
#include "url/gurl.h"
namespace keys = extensions::tabs_constants;
@@ -144,6 +145,10 @@ DictionaryValue* ExtensionTabUtil::CreateTabValue(
tab_strip && tab_strip->IsTabPinned(tab_index));
result->SetBoolean(keys::kIncognitoKey,
contents->GetBrowserContext()->IsOffTheRecord());
+ result->SetInteger(keys::kWidthKey,
+ contents->GetView()->GetContainerSize().width());
+ result->SetInteger(keys::kHeightKey,
+ contents->GetView()->GetContainerSize().height());
// Privacy-sensitive fields: these should be stripped off by
// ScrubTabValueForExtension if the extension should not see them.
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_tabs_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698