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

Unified Diff: chrome/browser/ui/panels/panel_window_controller_cocoa.mm

Issue 7734003: Implement basic theming for panel titlebars. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 4 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/panels/panel_window_controller_cocoa.mm
diff --git a/chrome/browser/ui/panels/panel_window_controller_cocoa.mm b/chrome/browser/ui/panels/panel_window_controller_cocoa.mm
index f521570f8f8183912a100365df2cf1bc9816703c..b63f6ac3ce23703d7e5bdf77fe7df303d0ccaffe 100644
--- a/chrome/browser/ui/panels/panel_window_controller_cocoa.mm
+++ b/chrome/browser/ui/panels/panel_window_controller_cocoa.mm
@@ -8,9 +8,14 @@
#include "base/logging.h"
#include "base/mac/mac_util.h"
+#include "base/sys_string_conversions.h"
#include "chrome/app/chrome_command_ids.h" // IDC_*
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tabs/tab_strip_model.h"
+#include "chrome/browser/themes/theme_service.h"
+#include "chrome/browser/themes/theme_service_factory.h"
#include "chrome/browser/ui/browser.h"
+#import "chrome/browser/ui/cocoa/browser_window_utils.h"
#import "chrome/browser/ui/cocoa/event_utils.h"
#import "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h"
#import "chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.h"
@@ -42,6 +47,22 @@ enum {
return self;
}
+- (ui::ThemeProvider*)themeProvider {
+ return ThemeServiceFactory::GetForProfile(windowShim_->browser()->profile());
+}
+
+- (ThemedWindowStyle)themedWindowStyle {
+ ThemedWindowStyle style = THEMED_POPUP;
+ if (windowShim_->browser()->profile()->IsOffTheRecord())
+ style |= THEMED_INCOGNITO;
+ return style;
+}
+
+- (NSPoint)themePatternPhase {
+ NSView* windowView = [[[self window] contentView] superview];
+ return [BrowserWindowUtils themePatternPhaseFor:windowView withTabStrip:nil];
+}
+
- (void)awakeFromNib {
NSWindow* window = [self window];
@@ -106,6 +127,16 @@ enum {
[self enableTabContentsViewAutosizing];
}
+- (void)updateTitleBar {
+ NSString* newTitle = base::SysUTF16ToNSString(
+ windowShim_->browser()->GetWindowTitleForCurrentTab());
+ pendingWindowTitle_.reset(
+ [BrowserWindowUtils scheduleReplaceOldTitle:pendingWindowTitle_.get()
+ withNewTitle:newTitle
+ forWindow:[self window]]);
+ [titlebar_view_ setTitle:newTitle];
+}
+
- (void)addFindBar:(FindBarCocoaController*)findBarCocoaController {
NSView* contentView = [[self window] contentView];
[contentView addSubview:[findBarCocoaController view]];

Powered by Google App Engine
This is Rietveld 408576698