Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/extensions/api/tabs/tabs_api.h" | 5 #include "chrome/browser/extensions/api/tabs/tabs_api.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 745 break; | 745 break; |
| 746 default: | 746 default: |
| 747 break; | 747 break; |
| 748 } | 748 } |
| 749 | 749 |
| 750 gfx::Rect bounds; | 750 gfx::Rect bounds; |
| 751 if (controller->window()->IsMinimized()) | 751 if (controller->window()->IsMinimized()) |
| 752 bounds = controller->window()->GetRestoredBounds(); | 752 bounds = controller->window()->GetRestoredBounds(); |
| 753 else | 753 else |
| 754 bounds = controller->window()->GetBounds(); | 754 bounds = controller->window()->GetBounds(); |
| 755 // TODO: Updating bounds during a drag can cause problems and a more general | |
| 756 // solution is needed. See http://crbug.com/251813 . | |
|
flackr
2013/06/20 23:00:57
nit: I'd put this on the call to SetBounds.
varkha
2013/06/20 23:10:04
Done.
| |
| 755 bool set_bounds = false; | 757 bool set_bounds = false; |
| 756 | 758 |
| 757 // Any part of the bounds can optionally be set by the caller. | 759 // Any part of the bounds can optionally be set by the caller. |
| 758 int bounds_val; | 760 int bounds_val; |
| 759 if (update_props->HasKey(keys::kLeftKey)) { | 761 if (update_props->HasKey(keys::kLeftKey)) { |
| 760 EXTENSION_FUNCTION_VALIDATE(update_props->GetInteger( | 762 EXTENSION_FUNCTION_VALIDATE(update_props->GetInteger( |
| 761 keys::kLeftKey, | 763 keys::kLeftKey, |
| 762 &bounds_val)); | 764 &bounds_val)); |
| 763 bounds.set_x(bounds_val); | 765 bounds.set_x(bounds_val); |
| 764 set_bounds = true; | 766 set_bounds = true; |
| (...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2067 execute_tab_id_ = tab_id; | 2069 execute_tab_id_ = tab_id; |
| 2068 details_ = details.Pass(); | 2070 details_ = details.Pass(); |
| 2069 return true; | 2071 return true; |
| 2070 } | 2072 } |
| 2071 | 2073 |
| 2072 bool TabsInsertCSSFunction::ShouldInsertCSS() const { | 2074 bool TabsInsertCSSFunction::ShouldInsertCSS() const { |
| 2073 return true; | 2075 return true; |
| 2074 } | 2076 } |
| 2075 | 2077 |
| 2076 } // namespace extensions | 2078 } // namespace extensions |
| OLD | NEW |