OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <Carbon/Carbon.h> | 5 #include <Carbon/Carbon.h> |
6 | 6 |
7 #include "base/mac_util.h" | 7 #include "base/mac_util.h" |
8 #include "base/scoped_nsdisable_screen_updates.h" | 8 #include "base/scoped_nsdisable_screen_updates.h" |
9 #import "base/scoped_nsobject.h" | 9 #import "base/scoped_nsobject.h" |
10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
(...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1274 // TODO(pinkerton): This might be a good candidate for a singleton. | 1274 // TODO(pinkerton): This might be a good candidate for a singleton. |
1275 typedef std::pair<std::string, BOOL> ThemeKey; | 1275 typedef std::pair<std::string, BOOL> ThemeKey; |
1276 static std::map<ThemeKey, GTMTheme*> cache; | 1276 static std::map<ThemeKey, GTMTheme*> cache; |
1277 ThemeKey key(provider->GetThemeID(), isOffTheRecord); | 1277 ThemeKey key(provider->GetThemeID(), isOffTheRecord); |
1278 GTMTheme* theme = cache[key]; | 1278 GTMTheme* theme = cache[key]; |
1279 if (theme) | 1279 if (theme) |
1280 return theme; | 1280 return theme; |
1281 | 1281 |
1282 theme = [[GTMTheme alloc] init]; // "Leak" it in the cache. | 1282 theme = [[GTMTheme alloc] init]; // "Leak" it in the cache. |
1283 cache[key] = theme; | 1283 cache[key] = theme; |
| 1284 |
| 1285 // TODO(pinkerton): Need to be able to theme the entire incognito window |
| 1286 // http://crbug.com/18568 The hardcoding of the colors here will need to be |
| 1287 // removed when that bug is addressed, but are here in order for things to be |
| 1288 // usable in the meantime. |
1284 if (isOffTheRecord) { | 1289 if (isOffTheRecord) { |
1285 NSColor* incognitoColor = [NSColor colorWithCalibratedRed:83/255.0 | 1290 NSColor* incognitoColor = [NSColor colorWithCalibratedRed:83/255.0 |
1286 green:108.0/255.0 | 1291 green:108.0/255.0 |
1287 blue:140/255.0 | 1292 blue:140/255.0 |
1288 alpha:1.0]; | 1293 alpha:1.0]; |
1289 [theme setBackgroundColor:incognitoColor]; | 1294 [theme setBackgroundColor:incognitoColor]; |
| 1295 [theme setValue:[NSColor blackColor] |
| 1296 forAttribute:@"textColor" |
| 1297 style:GTMThemeStyleToolBar |
| 1298 state:GTMThemeStateActiveWindow]; |
| 1299 [theme setValue:[NSColor blackColor] |
| 1300 forAttribute:@"textColor" |
| 1301 style:GTMThemeStyleTabBarDeselected |
| 1302 state:GTMThemeStateActiveWindow]; |
1290 return theme; | 1303 return theme; |
1291 } | 1304 } |
1292 | 1305 |
1293 NSImage* frameImage = provider->GetNSImageNamed(IDR_THEME_FRAME); | 1306 NSImage* frameImage = provider->GetNSImageNamed(IDR_THEME_FRAME); |
1294 NSImage* frameInactiveImage = | 1307 NSImage* frameInactiveImage = |
1295 provider->GetNSImageNamed(IDR_THEME_FRAME_INACTIVE); | 1308 provider->GetNSImageNamed(IDR_THEME_FRAME_INACTIVE); |
1296 | 1309 |
1297 [theme setValue:frameImage | 1310 [theme setValue:frameImage |
1298 forAttribute:@"backgroundImage" | 1311 forAttribute:@"backgroundImage" |
1299 style:GTMThemeStyleWindow | 1312 style:GTMThemeStyleWindow |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1379 provider->GetNSColor(BrowserThemeProvider::COLOR_TOOLBAR); | 1392 provider->GetNSColor(BrowserThemeProvider::COLOR_TOOLBAR); |
1380 [theme setValue:toolbarBackgroundColor | 1393 [theme setValue:toolbarBackgroundColor |
1381 forAttribute:@"backgroundColor" | 1394 forAttribute:@"backgroundColor" |
1382 style:GTMThemeStyleToolBar | 1395 style:GTMThemeStyleToolBar |
1383 state:GTMThemeStateActiveWindow]; | 1396 state:GTMThemeStateActiveWindow]; |
1384 | 1397 |
1385 return theme; | 1398 return theme; |
1386 } | 1399 } |
1387 @end | 1400 @end |
1388 | 1401 |
OLD | NEW |