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

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 (comments) 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..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:/
« ash/wm/toplevel_window_event_handler.cc ('K') | « ash/wm/toplevel_window_event_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698