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

Unified Diff: chrome/browser/extensions/api/tabs/tabs_api.cc

Issue 17431003: Dragging panels near screen edge (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Dragging panels near screen edge (fixed broken test) Created 7 years, 6 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/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..faab4a84eeb63cddb3782d7826ee2185863baad1 100644
--- a/chrome/browser/extensions/api/tabs/tabs_api.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_api.cc
@@ -760,32 +760,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) {
« ash/wm/panels/panel_window_resizer.cc ('K') | « ash/wm/panels/panel_window_resizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698