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

Unified Diff: chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_api.cc

Issue 10383104: Extract executeScript-like functionality into a single ExtensionScriptExecutor class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 7 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/extensions/api/offscreen_tabs/offscreen_tabs_api.cc
diff --git a/chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_api.cc b/chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_api.cc
index e50fdfa7c98f49a73cc0cbafba469df81dcf8cc4..52e9da98ed5b1d1d9709891a5bd556eaecc30911 100644
--- a/chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_api.cc
+++ b/chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_api.cc
@@ -799,7 +799,7 @@ bool UpdateOffscreenTabFunction::RunImpl() {
DictionaryValue* update_props;
EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &update_props));
- web_contents_ = offscreen_tab->web_contents();
+ tab_contents_ = offscreen_tab->tab_contents();
bool is_async = false;
if (!UpdateURLIfPresent(update_props, &is_async))
return false;
@@ -807,19 +807,22 @@ bool UpdateOffscreenTabFunction::RunImpl() {
// Update the width and height, if specified.
if (update_props->HasKey(tabs_keys::kWidthKey) ||
update_props->HasKey(tabs_keys::kHeightKey)) {
+ const gfx::Size& size =
+ tab_contents_->web_contents()->GetView()->GetContainerSize();
+
int width;
if (update_props->HasKey(tabs_keys::kWidthKey))
EXTENSION_FUNCTION_VALIDATE(
update_props->GetInteger(tabs_keys::kWidthKey, &width));
else
- web_contents_->GetView()->GetContainerSize().width();
+ width = size.width();
koz (OOO until 15th September) 2012/05/11 01:09:16 Good spot!
int height;
if (update_props->HasKey(tabs_keys::kHeightKey))
EXTENSION_FUNCTION_VALIDATE(
update_props->GetInteger(tabs_keys::kHeightKey, &height));
else
- web_contents_->GetView()->GetContainerSize().height();
+ height = size.height();
offscreen_tab->SetSize(width, height);
}

Powered by Google App Engine
This is Rietveld 408576698