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

Side by Side Diff: chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc

Issue 10797003: Change variable name to avoid scoping issues. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/ui/gtk/tabs/tab_strip_gtk.h" 5 #include "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after
1272 NOTIMPLEMENTED(); 1272 NOTIMPLEMENTED();
1273 } 1273 }
1274 1274
1275 void TabStripGtk::MaybeStartDrag(TabGtk* tab, const gfx::Point& point) { 1275 void TabStripGtk::MaybeStartDrag(TabGtk* tab, const gfx::Point& point) {
1276 // Don't accidentally start any drag operations during animations if the 1276 // Don't accidentally start any drag operations during animations if the
1277 // mouse is down. 1277 // mouse is down.
1278 if (IsAnimating() || tab->closing() || !HasAvailableDragActions()) 1278 if (IsAnimating() || tab->closing() || !HasAvailableDragActions())
1279 return; 1279 return;
1280 1280
1281 std::vector<TabGtk*> tabs; 1281 std::vector<TabGtk*> tabs;
1282 bool tab_found = false;
1282 for (size_t i = 0; i < model()->selection_model().size(); i++) { 1283 for (size_t i = 0; i < model()->selection_model().size(); i++) {
1283 TabGtk* tab = GetTabAt(model()->selection_model().selected_indices()[i]); 1284 TabGtk* selected_tab =
1284 if (!tab->closing()) 1285 GetTabAt(model()->selection_model().selected_indices()[i]);
sky 2012/07/18 21:12:04 In looking at this again, this should be GetTabAtA
1285 tabs.push_back(tab); 1286 if (!selected_tab->closing()) {
1287 tabs.push_back(selected_tab);
1288 if (selected_tab == tab)
1289 tab_found = true;
1290 }
1286 } 1291 }
1292 // If the tab was not in the selection we cannot start the drag operation.
1293 if (!tab_found)
sky 2012/07/18 21:12:04 This should be a DCHECK, and you should make it a
1294 return;
1287 1295
1288 drag_controller_.reset(new DraggedTabControllerGtk(this, tab, tabs)); 1296 drag_controller_.reset(new DraggedTabControllerGtk(this, tab, tabs));
1289 drag_controller_->CaptureDragInfo(point); 1297 drag_controller_->CaptureDragInfo(point);
1290 } 1298 }
1291 1299
1292 void TabStripGtk::ContinueDrag(GdkDragContext* context) { 1300 void TabStripGtk::ContinueDrag(GdkDragContext* context) {
1293 // We can get called even if |MaybeStartDrag| wasn't called in the event of 1301 // We can get called even if |MaybeStartDrag| wasn't called in the event of
1294 // a TabStrip animation when the mouse button is down. In this case we should 1302 // a TabStrip animation when the mouse button is down. In this case we should
1295 // _not_ continue the drag because it can lead to weird bugs. 1303 // _not_ continue the drag because it can lead to weird bugs.
1296 if (drag_controller_.get()) 1304 if (drag_controller_.get())
(...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after
2265 } 2273 }
2266 2274
2267 void TabStripGtk::SetNewTabButtonBackground() { 2275 void TabStripGtk::SetNewTabButtonBackground() {
2268 SkColor color = theme_service_->GetColor( 2276 SkColor color = theme_service_->GetColor(
2269 ThemeService::COLOR_BUTTON_BACKGROUND); 2277 ThemeService::COLOR_BUTTON_BACKGROUND);
2270 SkBitmap* background = theme_service_->GetBitmapNamed( 2278 SkBitmap* background = theme_service_->GetBitmapNamed(
2271 IDR_THEME_WINDOW_CONTROL_BACKGROUND); 2279 IDR_THEME_WINDOW_CONTROL_BACKGROUND);
2272 SkBitmap* mask = theme_service_->GetBitmapNamed(IDR_NEWTAB_BUTTON_MASK); 2280 SkBitmap* mask = theme_service_->GetBitmapNamed(IDR_NEWTAB_BUTTON_MASK);
2273 newtab_button_->SetBackground(color, background, mask); 2281 newtab_button_->SetBackground(color, background, mask);
2274 } 2282 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698