| 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 #import "chrome/browser/cocoa/download_shelf_controller.h" | 5 #import "chrome/browser/cocoa/download_shelf_controller.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/mac_util.h" | 9 #include "base/mac_util.h" |
| 10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 // Adapt appearance to the current theme. Called after theme changes and before | 107 // Adapt appearance to the current theme. Called after theme changes and before |
| 108 // this is shown for the first time. | 108 // this is shown for the first time. |
| 109 - (void)updateTheme:(GTMTheme*)theme { | 109 - (void)updateTheme:(GTMTheme*)theme { |
| 110 // For the default theme, use a blue color for the link. Ideally, we'd want to | 110 // For the default theme, use a blue color for the link. Ideally, we'd want to |
| 111 // compare the current theme id with kDefaultThemeID, but the classic theme | 111 // compare the current theme id with kDefaultThemeID, but the classic theme |
| 112 // from the gallery does have a different id. Hence, we use the blue color if | 112 // from the gallery does have a different id. Hence, we use the blue color if |
| 113 // the current theme does not change the bookmark text color. | 113 // the current theme does not change the bookmark text color. |
| 114 BOOL useDefaultColor = YES; | 114 BOOL useDefaultColor = YES; |
| 115 if (bridge_.get() && bridge_->browser() && bridge_->browser()->profile()) { | 115 if (bridge_.get() && bridge_->browser() && bridge_->browser()->profile()) { |
| 116 ThemeProvider* provider = bridge_->browser()->profile()->GetThemeProvider(); | 116 ThemeProvider* provider = bridge_->browser()->profile()->GetThemeProvider(); |
| 117 if (provider) | 117 if (provider) { |
| 118 useDefaultColor = provider->GetColor( | 118 useDefaultColor = provider->GetColor( |
| 119 BrowserThemeProvider::COLOR_BOOKMARK_TEXT) == | 119 BrowserThemeProvider::COLOR_BOOKMARK_TEXT) == |
| 120 BrowserThemeProvider::kDefaultColorBookmarkText; | 120 BrowserThemeProvider::GetDefaultColor( |
| 121 BrowserThemeProvider::COLOR_BOOKMARK_TEXT); |
| 122 } |
| 121 } | 123 } |
| 122 | 124 |
| 123 NSColor* color = useDefaultColor ? | 125 NSColor* color = useDefaultColor ? |
| 124 [HyperlinkButtonCell defaultTextColor] : | 126 [HyperlinkButtonCell defaultTextColor] : |
| 125 [theme textColorForStyle:GTMThemeStyleBookmarksBarButton | 127 [theme textColorForStyle:GTMThemeStyleBookmarksBarButton |
| 126 state:GTMThemeStateActiveWindow]; | 128 state:GTMThemeStateActiveWindow]; |
| 127 [showAllDownloadsCell_ setTextColor:color]; | 129 [showAllDownloadsCell_ setTextColor:color]; |
| 128 } | 130 } |
| 129 | 131 |
| 130 - (AnimatableView*)animatableView { | 132 - (AnimatableView*)animatableView { |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 if (isTransferDone && | 300 if (isTransferDone && |
| 299 [itemController download]->safety_state() != DownloadItem::DANGEROUS) { | 301 [itemController download]->safety_state() != DownloadItem::DANGEROUS) { |
| 300 [self remove:itemController]; | 302 [self remove:itemController]; |
| 301 } else { | 303 } else { |
| 302 ++i; | 304 ++i; |
| 303 } | 305 } |
| 304 } | 306 } |
| 305 } | 307 } |
| 306 | 308 |
| 307 @end | 309 @end |
| OLD | NEW |