| 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/ui/views/tabs/tab_strip.h" | 5 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windowsx.h> | 8 #include <windowsx.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1149 if (previous_tab_bounds.right() + tab_h_offset() != tab_bounds.x()) { | 1149 if (previous_tab_bounds.right() + tab_h_offset() != tab_bounds.x()) { |
| 1150 int x = previous_tab_bounds.right() - tab_bounds.x() - | 1150 int x = previous_tab_bounds.right() - tab_bounds.x() - |
| 1151 stacked_tab_right_clip(); | 1151 stacked_tab_right_clip(); |
| 1152 clip->SetRect(x, 0, tab_bounds.width() - x, tab_bounds.height()); | 1152 clip->SetRect(x, 0, tab_bounds.width() - x, tab_bounds.height()); |
| 1153 } | 1153 } |
| 1154 } | 1154 } |
| 1155 return true; | 1155 return true; |
| 1156 } | 1156 } |
| 1157 | 1157 |
| 1158 void TabStrip::SetImmersiveStyle(bool enable) { | 1158 void TabStrip::SetImmersiveStyle(bool enable) { |
| 1159 if (immersive_style_ == enable) |
| 1160 return; |
| 1159 immersive_style_ = enable; | 1161 immersive_style_ = enable; |
| 1160 if (immersive_style_) { | 1162 if (immersive_style_) { |
| 1161 // Dominant colors are only updated automatically when the tab strip is | 1163 // Dominant colors are only updated automatically when the tab strip is |
| 1162 // already using immersive style. Compute the initial values. | 1164 // already using immersive style. Compute the initial values. |
| 1163 for (int i = 0; i < tab_count(); ++i) | 1165 for (int i = 0; i < tab_count(); ++i) |
| 1164 tab_at(i)->UpdateIconDominantColor(); | 1166 tab_at(i)->UpdateIconDominantColor(); |
| 1165 } | 1167 } |
| 1166 } | 1168 } |
| 1167 | 1169 |
| 1168 bool TabStrip::IsImmersiveStyle() const { | 1170 bool TabStrip::IsImmersiveStyle() const { |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1380 if (view) | 1382 if (view) |
| 1381 return view; | 1383 return view; |
| 1382 } | 1384 } |
| 1383 Tab* tab = FindTabForEvent(point); | 1385 Tab* tab = FindTabForEvent(point); |
| 1384 if (tab) | 1386 if (tab) |
| 1385 return ConvertPointToViewAndGetEventHandler(this, tab, point); | 1387 return ConvertPointToViewAndGetEventHandler(this, tab, point); |
| 1386 } | 1388 } |
| 1387 return this; | 1389 return this; |
| 1388 } | 1390 } |
| 1389 | 1391 |
| 1392 // static |
| 1393 int TabStrip::GetImmersiveHeight() { |
| 1394 return Tab::GetImmersiveHeight(); |
| 1395 } |
| 1396 |
| 1390 int TabStrip::GetMiniTabCount() const { | 1397 int TabStrip::GetMiniTabCount() const { |
| 1391 int mini_count = 0; | 1398 int mini_count = 0; |
| 1392 while (mini_count < tab_count() && tab_at(mini_count)->data().mini) | 1399 while (mini_count < tab_count() && tab_at(mini_count)->data().mini) |
| 1393 mini_count++; | 1400 mini_count++; |
| 1394 return mini_count; | 1401 return mini_count; |
| 1395 } | 1402 } |
| 1396 | 1403 |
| 1397 /////////////////////////////////////////////////////////////////////////////// | 1404 /////////////////////////////////////////////////////////////////////////////// |
| 1398 // TabStrip, views::ButtonListener implementation: | 1405 // TabStrip, views::ButtonListener implementation: |
| 1399 | 1406 |
| (...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2564 if (!adjust_layout_) | 2571 if (!adjust_layout_) |
| 2565 return false; | 2572 return false; |
| 2566 | 2573 |
| 2567 #if !defined(OS_CHROMEOS) | 2574 #if !defined(OS_CHROMEOS) |
| 2568 if (ui::GetDisplayLayout() != ui::LAYOUT_TOUCH) | 2575 if (ui::GetDisplayLayout() != ui::LAYOUT_TOUCH) |
| 2569 return false; | 2576 return false; |
| 2570 #endif | 2577 #endif |
| 2571 | 2578 |
| 2572 return true; | 2579 return true; |
| 2573 } | 2580 } |
| OLD | NEW |