Chromium Code Reviews| Index: chrome/browser/extensions/api/tabs/tabs_api.cc |
| diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc |
| index 81d938e97ae29e6b6e555527f49811fd90f2a4f9..cac67b0d6956563397f0a15e60be405a5d66193f 100644 |
| --- a/chrome/browser/extensions/api/tabs/tabs_api.cc |
| +++ b/chrome/browser/extensions/api/tabs/tabs_api.cc |
| @@ -752,6 +752,8 @@ bool WindowsUpdateFunction::RunImpl() { |
| bounds = controller->window()->GetRestoredBounds(); |
| else |
| bounds = controller->window()->GetBounds(); |
| + // TODO: Updating bounds during a drag can cause problems and a more general |
| + // solution is needed. See http://crbug.com/251813 . |
| bool set_bounds = false; |
| // Any part of the bounds can optionally be set by the caller. |
| @@ -760,32 +762,40 @@ bool WindowsUpdateFunction::RunImpl() { |
| EXTENSION_FUNCTION_VALIDATE(update_props->GetInteger( |
| keys::kLeftKey, |
| &bounds_val)); |
| - bounds.set_x(bounds_val); |
| - set_bounds = true; |
| + if (bounds.x() != bounds_val) { |
| + bounds.set_x(bounds_val); |
| + set_bounds = true; |
| + } |
| } |
| if (update_props->HasKey(keys::kTopKey)) { |
| EXTENSION_FUNCTION_VALIDATE(update_props->GetInteger( |
| keys::kTopKey, |
| &bounds_val)); |
| - bounds.set_y(bounds_val); |
| - set_bounds = true; |
| + if (bounds.y() != bounds_val) { |
| + bounds.set_y(bounds_val); |
| + set_bounds = true; |
| + } |
| } |
| if (update_props->HasKey(keys::kWidthKey)) { |
| EXTENSION_FUNCTION_VALIDATE(update_props->GetInteger( |
| keys::kWidthKey, |
| &bounds_val)); |
| - bounds.set_width(bounds_val); |
| - set_bounds = true; |
| + if (bounds.width() != bounds_val) { |
| + bounds.set_width(bounds_val); |
| + set_bounds = true; |
| + } |
| } |
| if (update_props->HasKey(keys::kHeightKey)) { |
| EXTENSION_FUNCTION_VALIDATE(update_props->GetInteger( |
| keys::kHeightKey, |
| &bounds_val)); |
| - bounds.set_height(bounds_val); |
| - set_bounds = true; |
| + if (bounds.height() != bounds_val) { |
| + bounds.set_height(bounds_val); |
| + set_bounds = true; |
| + } |
| } |
| if (set_bounds) { |
|
flackr
2013/06/20 19:47:46
FYI, this comment may be relevant as well:
https:/
|