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

Side by Side Diff: chrome/browser/ui/cocoa/themed_window.h

Issue 18486007: Fix the misalignment on CrOS of the tab background images (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_view.mm ('k') | chrome/browser/ui/gtk/tabs/tab_renderer_gtk.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_UI_COCOA_THEMED_WINDOW_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_THEMED_WINDOW_H_
6 #define CHROME_BROWSER_UI_COCOA_THEMED_WINDOW_H_ 6 #define CHROME_BROWSER_UI_COCOA_THEMED_WINDOW_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 namespace ui { 10 namespace ui {
11 class ThemeProvider; 11 class ThemeProvider;
12 } 12 }
13 using ui::ThemeProvider; 13 using ui::ThemeProvider;
14 14
15 // Bit flags; mix-and-match as necessary. 15 // Bit flags; mix-and-match as necessary.
16 enum { 16 enum {
17 THEMED_NORMAL = 0, 17 THEMED_NORMAL = 0,
18 THEMED_INCOGNITO = 1 << 0, 18 THEMED_INCOGNITO = 1 << 0,
19 THEMED_POPUP = 1 << 1, 19 THEMED_POPUP = 1 << 1,
20 THEMED_DEVTOOLS = 1 << 2 20 THEMED_DEVTOOLS = 1 << 2
21 }; 21 };
22 typedef NSUInteger ThemedWindowStyle; 22 typedef NSUInteger ThemedWindowStyle;
23 23
24 // Indicates how the theme image should be aligned. 24 // Indicates how the theme image should be aligned.
25 enum ThemeImageAlignment { 25 enum ThemeImageAlignment {
26 // Aligns the top of the theme image with the top of the frame. Use this 26 // Aligns the top of the theme image with the top of the frame. Use this
27 // for IDR_THEME_THEME_FRAME.* 27 // for IDR_THEME_THEME_FRAME.* and IDR_THEME_TAB_BACKGROUND.
28 THEME_IMAGE_ALIGN_WITH_FRAME, 28 THEME_IMAGE_ALIGN_WITH_FRAME,
29 // Aligns the top of the theme image with the top of the tabs. 29 // Aligns the top of the theme image with the top of the tabs.
30 // Use this for IDR_THEME_TAB_BACKGROUND and IDR_THEME_TOOLBAR. 30 // Use this for IDR_THEME_TAB_BACKGROUND_OVERLAY,
31 // IDR_THEME_TAB_BACKGROUND_INACTIVE, and IDR_THEME_TOOLBAR.
31 THEME_IMAGE_ALIGN_WITH_TAB_STRIP 32 THEME_IMAGE_ALIGN_WITH_TAB_STRIP
32 }; 33 };
33 34
34 // Implemented by windows that support theming. 35 // Implemented by windows that support theming.
35 36
36 @interface NSWindow (ThemeProvider) 37 @interface NSWindow (ThemeProvider)
37 - (ThemeProvider*)themeProvider; 38 - (ThemeProvider*)themeProvider;
38 - (ThemedWindowStyle)themedWindowStyle; 39 - (ThemedWindowStyle)themedWindowStyle;
39 40
40 // Returns the position in the coordinates of the root view 41 // Returns the position in the coordinates of the root view
41 // ([[self contentView] superview]) that the top left of a theme image with 42 // ([[self contentView] superview]) that the top left of a theme image with
42 // |alignment| should be painted at. The result of this method can be used in 43 // |alignment| should be painted at. The result of this method can be used in
43 // conjunction with [NSGraphicsContext cr_setPatternPhase:] to set the offset of 44 // conjunction with [NSGraphicsContext cr_setPatternPhase:] to set the offset of
44 // pattern colors. 45 // pattern colors.
45 - (NSPoint)themeImagePositionForAlignment:(ThemeImageAlignment)alignment; 46 - (NSPoint)themeImagePositionForAlignment:(ThemeImageAlignment)alignment;
46 @end 47 @end
47 48
48 #endif // CHROME_BROWSER_UI_COCOA_THEMED_WINDOW_H_ 49 #endif // CHROME_BROWSER_UI_COCOA_THEMED_WINDOW_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_view.mm ('k') | chrome/browser/ui/gtk/tabs/tab_renderer_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698