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

Side by Side Diff: chrome/browser/ui/views/tabs/tab_strip.cc

Issue 2447833002: Fix new tab button (broken when removing pre-MD code). (Closed)
Patch Set: Created 4 years, 1 month 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
« 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/views/tabs/tab_strip.h" 5 #include "chrome/browser/ui/views/tabs/tab_strip.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <iterator> 10 #include <iterator>
(...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1435 // Now selected but not active. We don't want these dimmed if using native 1435 // Now selected but not active. We don't want these dimmed if using native
1436 // frame, so they're painted after initial pass. 1436 // frame, so they're painted after initial pass.
1437 for (size_t i = 0; i < selected_tabs.size(); ++i) 1437 for (size_t i = 0; i < selected_tabs.size(); ++i)
1438 selected_tabs[i]->Paint(context); 1438 selected_tabs[i]->Paint(context);
1439 1439
1440 // Next comes the active tab. 1440 // Next comes the active tab.
1441 if (active_tab && !is_dragging) 1441 if (active_tab && !is_dragging)
1442 active_tab->Paint(context); 1442 active_tab->Paint(context);
1443 1443
1444 // Paint the New Tab button. 1444 // Paint the New Tab button.
1445 if (newtab_button_->state() != views::CustomButton::STATE_PRESSED) { 1445 if (newtab_button_->state() == views::CustomButton::STATE_PRESSED) {
1446 newtab_button_->Paint(context);
1447 } else {
1446 // Match the inactive tab opacity for non-pressed states. See comments in 1448 // Match the inactive tab opacity for non-pressed states. See comments in
1447 // NewTabButton::PaintFill() for why we don't do this for the pressed state. 1449 // NewTabButton::PaintFill() for why we don't do this for the pressed state.
1448 // This call doesn't need to set |lcd_text_requires_opaque_layer| to false 1450 // This call doesn't need to set |lcd_text_requires_opaque_layer| to false
1449 // because no text will be drawn. 1451 // because no text will be drawn.
1450 ui::CompositingRecorder opacity_recorder(context, GetInactiveAlpha(true), 1452 ui::CompositingRecorder opacity_recorder(context, GetInactiveAlpha(true),
1451 true); 1453 true);
1452 newtab_button_->Paint(context); 1454 newtab_button_->Paint(context);
1453 } 1455 }
1454 1456
1455 // And the dragged tabs. 1457 // And the dragged tabs.
(...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after
2799 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); 2801 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point);
2800 if (view) 2802 if (view)
2801 return view; 2803 return view;
2802 } 2804 }
2803 Tab* tab = FindTabForEvent(point); 2805 Tab* tab = FindTabForEvent(point);
2804 if (tab) 2806 if (tab)
2805 return ConvertPointToViewAndGetEventHandler(this, tab, point); 2807 return ConvertPointToViewAndGetEventHandler(this, tab, point);
2806 } 2808 }
2807 return this; 2809 return this;
2808 } 2810 }
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