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

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_controller.mm

Issue 1492423003: Rejigger ThemeService: move exposure of ThemeProvider interface to a (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix that unittest Created 5 years 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #import "chrome/browser/ui/cocoa/browser_window_controller.h" 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <numeric> 8 #include <numeric>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1528 matching lines...) Expand 10 before | Expand all | Expand 10 after
1539 [rootView cr_recursivelyInvokeBlock:^(id view) { 1539 [rootView cr_recursivelyInvokeBlock:^(id view) {
1540 if ([view conformsToProtocol:@protocol(ThemedWindowDrawing)]) 1540 if ([view conformsToProtocol:@protocol(ThemedWindowDrawing)])
1541 [view windowDidChangeTheme]; 1541 [view windowDidChangeTheme];
1542 1542
1543 // TODO(andresantoso): Remove this once all themed views respond to 1543 // TODO(andresantoso): Remove this once all themed views respond to
1544 // windowDidChangeTheme above. 1544 // windowDidChangeTheme above.
1545 [view setNeedsDisplay:YES]; 1545 [view setNeedsDisplay:YES];
1546 }]; 1546 }];
1547 } 1547 }
1548 1548
1549 // TODO(estade): change this function to return a const* or const& and remove
1550 // this cast.
1549 - (ui::ThemeProvider*)themeProvider { 1551 - (ui::ThemeProvider*)themeProvider {
1550 return ThemeServiceFactory::GetForProfile(browser_->profile()); 1552 return const_cast<ui::ThemeProvider*>(
1553 &ThemeService::GetThemeProviderForProfile(browser_->profile()));
1551 } 1554 }
1552 1555
1553 - (ThemedWindowStyle)themedWindowStyle { 1556 - (ThemedWindowStyle)themedWindowStyle {
1554 ThemedWindowStyle style = 0; 1557 ThemedWindowStyle style = 0;
1555 if (browser_->profile()->IsOffTheRecord()) 1558 if (browser_->profile()->IsOffTheRecord())
1556 style |= THEMED_INCOGNITO; 1559 style |= THEMED_INCOGNITO;
1557 1560
1558 if (browser_->is_devtools()) 1561 if (browser_->is_devtools())
1559 style |= THEMED_DEVTOOLS; 1562 style |= THEMED_DEVTOOLS;
1560 if (browser_->is_type_popup()) 1563 if (browser_->is_type_popup())
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
2098 2101
2099 - (BOOL)supportsBookmarkBar { 2102 - (BOOL)supportsBookmarkBar {
2100 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; 2103 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR];
2101 } 2104 }
2102 2105
2103 - (BOOL)isTabbedWindow { 2106 - (BOOL)isTabbedWindow {
2104 return browser_->is_type_tabbed(); 2107 return browser_->is_type_tabbed();
2105 } 2108 }
2106 2109
2107 @end // @implementation BrowserWindowController(WindowType) 2110 @end // @implementation BrowserWindowController(WindowType)
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_button.h ('k') | chrome/browser/ui/cocoa/gradient_button_cell.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698