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 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <iterator> | 10 #include <iterator> |
(...skipping 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1389 | 1389 |
1390 if (GetWidget()->ShouldWindowContentsBeTransparent()) { | 1390 if (GetWidget()->ShouldWindowContentsBeTransparent()) { |
1391 const int kBackgroundIdGlass = IDR_THEME_TAB_BACKGROUND_V; | 1391 const int kBackgroundIdGlass = IDR_THEME_TAB_BACKGROUND_V; |
1392 *custom_image = tp->HasCustomImage(kBackgroundIdGlass); | 1392 *custom_image = tp->HasCustomImage(kBackgroundIdGlass); |
1393 return kBackgroundIdGlass; | 1393 return kBackgroundIdGlass; |
1394 } | 1394 } |
1395 | 1395 |
1396 // If a custom theme does not provide a replacement tab background, but does | 1396 // If a custom theme does not provide a replacement tab background, but does |
1397 // provide a replacement frame image, HasCustomImage() on the tab background | 1397 // provide a replacement frame image, HasCustomImage() on the tab background |
1398 // ID will return false, but the theme provider will make a custom image from | 1398 // ID will return false, but the theme provider will make a custom image from |
1399 // the frame image. | 1399 // the frame image. Furthermore, since the theme provider will create the |
| 1400 // incognito frame image from the normal frame image, in incognito mode we |
| 1401 // need to look for a custom incognito _or_ regular frame image. |
1400 const bool incognito = controller()->IsIncognito(); | 1402 const bool incognito = controller()->IsIncognito(); |
1401 const int id = incognito ? | 1403 const int id = incognito ? |
1402 IDR_THEME_TAB_BACKGROUND_INCOGNITO : IDR_THEME_TAB_BACKGROUND; | 1404 IDR_THEME_TAB_BACKGROUND_INCOGNITO : IDR_THEME_TAB_BACKGROUND; |
1403 const int frame_id = incognito ? IDR_THEME_FRAME_INCOGNITO : IDR_THEME_FRAME; | 1405 const int frame_id = incognito ? IDR_THEME_FRAME_INCOGNITO : IDR_THEME_FRAME; |
1404 *custom_image = tp->HasCustomImage(id) || tp->HasCustomImage(frame_id); | 1406 *custom_image = tp->HasCustomImage(id) || tp->HasCustomImage(frame_id) || |
| 1407 (incognito && tp->HasCustomImage(IDR_THEME_FRAME)); |
1405 return id; | 1408 return id; |
1406 } | 1409 } |
1407 | 1410 |
1408 void TabStrip::UpdateTabAccessibilityState(const Tab* tab, | 1411 void TabStrip::UpdateTabAccessibilityState(const Tab* tab, |
1409 ui::AXViewState* state) { | 1412 ui::AXViewState* state) { |
1410 state->count = tab_count(); | 1413 state->count = tab_count(); |
1411 state->index = GetModelIndexOfTab(tab); | 1414 state->index = GetModelIndexOfTab(tab); |
1412 } | 1415 } |
1413 | 1416 |
1414 void TabStrip::MouseMovedOutOfHost() { | 1417 void TabStrip::MouseMovedOutOfHost() { |
(...skipping 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2868 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); | 2871 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); |
2869 if (view) | 2872 if (view) |
2870 return view; | 2873 return view; |
2871 } | 2874 } |
2872 Tab* tab = FindTabForEvent(point); | 2875 Tab* tab = FindTabForEvent(point); |
2873 if (tab) | 2876 if (tab) |
2874 return ConvertPointToViewAndGetEventHandler(this, tab, point); | 2877 return ConvertPointToViewAndGetEventHandler(this, tab, point); |
2875 } | 2878 } |
2876 return this; | 2879 return this; |
2877 } | 2880 } |
OLD | NEW |