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

Unified Diff: chrome/browser/ui/cocoa/themed_window.h

Issue 19918002: Refactor [FramedBrowserWindow drawWindowThemeInDirtyRect:] to use themeImagePositionForAlignment: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 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
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_window_controller.mm ('k') | chrome/browser/ui/cocoa/themed_window.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/themed_window.h
diff --git a/chrome/browser/ui/cocoa/themed_window.h b/chrome/browser/ui/cocoa/themed_window.h
index f55379527877668b9ef1bc91aa2da5fbdcf84eb2..592e56722ae9d984e2bcc39d2e5553bbba4afd98 100644
--- a/chrome/browser/ui/cocoa/themed_window.h
+++ b/chrome/browser/ui/cocoa/themed_window.h
@@ -22,13 +22,13 @@ enum {
typedef NSUInteger ThemedWindowStyle;
// Indicates how the theme image should be aligned.
-enum ThemePatternAlignment {
+enum ThemeImageAlignment {
// Aligns the top of the theme image with the top of the frame. Use this
// for IDR_THEME_THEME_FRAME.*
- THEME_PATTERN_ALIGN_WITH_FRAME,
- // Aligns the top of the theme image with the top of the tab
- // strip. Use this for IDR_THEME_TAB_BACKGROUND and IDR_THEME_TOOLBAR.
- THEME_PATTERN_ALIGN_WITH_TAB_STRIP
+ THEME_IMAGE_ALIGN_WITH_FRAME,
+ // Aligns the top of the theme image with the top of the tabs.
+ // Use this for IDR_THEME_TAB_BACKGROUND and IDR_THEME_TOOLBAR.
+ THEME_IMAGE_ALIGN_WITH_TAB_STRIP
};
// Implemented by windows that support theming.
@@ -36,7 +36,13 @@ enum ThemePatternAlignment {
@interface NSWindow (ThemeProvider)
- (ThemeProvider*)themeProvider;
- (ThemedWindowStyle)themedWindowStyle;
-- (NSPoint)themePatternPhaseForAlignment:(ThemePatternAlignment)alignment;
+
+// Returns the position in the coordinates of the root view
+// ([[self contentView] superview]) that the top left of a theme image with
+// |alignment| should be painted at. The result of this method can be used in
+// conjunction with [NSGraphicsContext cr_setPatternPhase:] to set the offset of
+// pattern colors.
+- (NSPoint)themeImagePositionForAlignment:(ThemeImageAlignment)alignment;
@end
#endif // CHROME_BROWSER_UI_COCOA_THEMED_WINDOW_H_
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_window_controller.mm ('k') | chrome/browser/ui/cocoa/themed_window.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698