Chromium Code Reviews| 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(); |
|
not at google - send to devlin
2012/05/11 00:43:23
hah found a bug!
|
| 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); |
| } |