summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/cocoa
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ui/cocoa')
-rw-r--r--chrome/browser/ui/cocoa/background_gradient_view.mm4
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h2
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm10
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm4
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.h5
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.mm4
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view_unittest.mm8
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm10
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_button.h5
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm10
-rw-r--r--chrome/browser/ui/cocoa/browser_frame_view.mm4
-rw-r--r--chrome/browser/ui/cocoa/browser_window_controller.h2
-rw-r--r--chrome/browser/ui/cocoa/browser_window_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/bubble_view.mm2
-rw-r--r--chrome/browser/ui/cocoa/chrome_browser_window.mm2
-rw-r--r--chrome/browser/ui/cocoa/download/download_item_cell.h2
-rw-r--r--chrome/browser/ui/cocoa/download/download_item_cell.mm27
-rw-r--r--chrome/browser/ui/cocoa/download/download_item_controller.mm20
-rw-r--r--chrome/browser/ui/cocoa/download/download_shelf_controller.mm3
-rw-r--r--chrome/browser/ui/cocoa/download/download_shelf_view.mm4
-rw-r--r--chrome/browser/ui/cocoa/external_protocol_dialog.mm6
-rw-r--r--chrome/browser/ui/cocoa/gradient_button_cell.h4
-rw-r--r--chrome/browser/ui/cocoa/gradient_button_cell.mm4
-rw-r--r--chrome/browser/ui/cocoa/infobars/infobar_gradient_view.mm2
-rw-r--r--chrome/browser/ui/cocoa/js_modal_dialog_cocoa.mm14
-rw-r--r--chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.mm5
-rw-r--r--chrome/browser/ui/cocoa/status_bubble_mac.mm6
-rw-r--r--chrome/browser/ui/cocoa/tabs/tab_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/tabs/tab_view.mm2
-rw-r--r--chrome/browser/ui/cocoa/tabs/tab_window_controller.mm4
-rw-r--r--chrome/browser/ui/cocoa/themed_window.h3
32 files changed, 100 insertions, 84 deletions
diff --git a/chrome/browser/ui/cocoa/background_gradient_view.mm b/chrome/browser/ui/cocoa/background_gradient_view.mm
index 1c5735f..7b031a2 100644
--- a/chrome/browser/ui/cocoa/background_gradient_view.mm
+++ b/chrome/browser/ui/cocoa/background_gradient_view.mm
@@ -33,7 +33,7 @@
- (void)drawBackground {
BOOL isKey = [[self window] isKeyWindow];
- ThemeProvider* themeProvider = [[self window] themeProvider];
+ ui::ThemeProvider* themeProvider = [[self window] themeProvider];
if (themeProvider) {
NSColor* backgroundImageColor =
themeProvider->GetNSImageColorNamed(IDR_THEME_TOOLBAR, false);
@@ -70,7 +70,7 @@
- (NSColor*)strokeColor {
BOOL isKey = [[self window] isKeyWindow];
- ThemeProvider* themeProvider = [[self window] themeProvider];
+ ui::ThemeProvider* themeProvider = [[self window] themeProvider];
if (!themeProvider)
return [NSColor blackColor];
return themeProvider->GetNSColor(
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h
index 6406ce98..4989f57 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h
@@ -386,7 +386,7 @@ willAnimateFromState:(bookmarks::VisualState)oldState
- (int64)nodeIdFromMenuTag:(int32)tag;
- (int32)menuTagFromNodeId:(int64)menuid;
- (const BookmarkNode*)nodeFromMenuItem:(id)sender;
-- (void)updateTheme:(ThemeProvider*)themeProvider;
+- (void)updateTheme:(ui::ThemeProvider*)themeProvider;
- (BookmarkButton*)buttonForDroppingOnAtPoint:(NSPoint)point;
- (BOOL)isEventAnExitEvent:(NSEvent*)event;
- (BOOL)shrinkOrHideView:(NSView*)view forMaxX:(CGFloat)maxViewX;
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
index 91a6ac5..04ada27 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
@@ -718,8 +718,8 @@ const NSTimeInterval kBookmarkBarAnimationDuration = 0.12;
// Called after the current theme has changed.
- (void)themeDidChangeNotification:(NSNotification*)aNotification {
- ThemeProvider* themeProvider =
- static_cast<ThemeProvider*>([[aNotification object] pointerValue]);
+ ui::ThemeProvider* themeProvider =
+ static_cast<ui::ThemeProvider*>([[aNotification object] pointerValue]);
[self updateTheme:themeProvider];
}
@@ -1103,7 +1103,7 @@ const NSTimeInterval kBookmarkBarAnimationDuration = 0.12;
// the hierarchy. If that second part is now true, set the color.
// (If not we'll set the color on the 1st themeChanged:
// notification.)
- ThemeProvider* themeProvider = [[[self view] window] themeProvider];
+ ui::ThemeProvider* themeProvider = [[[self view] window] themeProvider];
if (themeProvider) {
NSColor* color =
themeProvider->GetNSColor(BrowserThemeProvider::COLOR_BOOKMARK_TEXT,
@@ -1582,7 +1582,7 @@ const NSTimeInterval kBookmarkBarAnimationDuration = 0.12;
// because our trigger is an [NSView viewWillMoveToWindow:], which the
// controller doesn't normally know about. Otherwise we don't have
// access to the theme before we know what window we will be on.
-- (void)updateTheme:(ThemeProvider*)themeProvider {
+- (void)updateTheme:(ui::ThemeProvider*)themeProvider {
if (!themeProvider)
return;
NSColor* color =
@@ -1972,7 +1972,7 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
return tc ? tc->view()->GetContainerSize().height() : 0;
}
-- (ThemeProvider*)themeProvider {
+- (ui::ThemeProvider*)themeProvider {
return browser_->profile()->GetThemeProvider();
}
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm
index 80f6b19..95255c8 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm
@@ -4,7 +4,6 @@
#import <Cocoa/Cocoa.h>
-#include "app/theme_provider.h"
#include "base/basictypes.h"
#include "base/scoped_nsobject.h"
#include "base/string16.h"
@@ -29,6 +28,7 @@
#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
#import "third_party/ocmock/OCMock/OCMock.h"
+#include "ui/base/theme_provider.h"
// Just like a BookmarkBarController but openURL: is stubbed out.
@interface BookmarkBarControllerNoOpen : BookmarkBarController {
@@ -170,7 +170,7 @@
@end
-class FakeTheme : public ThemeProvider {
+class FakeTheme : public ui::ThemeProvider {
public:
FakeTheme(NSColor* color) : color_(color) { }
scoped_nsobject<NSColor> color_;
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm
index 5044e60..53bb97d 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm
@@ -1407,7 +1407,7 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
return y;
}
-- (ThemeProvider*)themeProvider {
+- (ui::ThemeProvider*)themeProvider {
return [parentController_ themeProvider];
}
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.h b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.h
index 1942ebd..02936ae 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.h
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.h
@@ -18,7 +18,10 @@
@class BookmarkBarView;
class TabContents;
+
+namespace ui {
class ThemeProvider;
+}
// An interface to allow mocking of a BookmarkBarController by the
// BookmarkBarToolbarView.
@@ -29,7 +32,7 @@ class ThemeProvider;
- (int)currentTabContentsHeight;
// Current theme provider, passed to the cross platform NtpBackgroundUtil class.
-- (ThemeProvider*)themeProvider;
+- (ui::ThemeProvider*)themeProvider;
@end
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.mm
index 760de17..16fb677 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.mm
@@ -4,7 +4,6 @@
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.h"
-#include "app/theme_provider.h"
#include "gfx/rect.h"
#include "chrome/browser/ntp_background_util.h"
#include "chrome/browser/themes/browser_theme_provider.h"
@@ -13,6 +12,7 @@
#import "chrome/browser/ui/cocoa/browser_window_controller.h"
#import "chrome/browser/ui/cocoa/themed_window.h"
#include "gfx/canvas_skia_paint.h"
+#include "ui/base/theme_provider.h"
const CGFloat kBorderRadius = 3.0;
@@ -45,7 +45,7 @@ const CGFloat kBorderRadius = 3.0;
NSRect bounds = [self bounds];
- ThemeProvider* themeProvider = [controller_ themeProvider];
+ ui::ThemeProvider* themeProvider = [controller_ themeProvider];
if (!themeProvider)
return;
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view_unittest.mm
index 24d971a..ef8bfc8 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view_unittest.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view_unittest.mm
@@ -4,7 +4,6 @@
#import <Cocoa/Cocoa.h>
-#include "app/theme_provider.h"
#include "base/scoped_nsobject.h"
#include "chrome/browser/themes/browser_theme_provider.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h"
@@ -16,6 +15,7 @@
#include "testing/platform_test.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkColor.h"
+#include "ui/base/theme_provider.h"
using ::testing::_;
using ::testing::DoAll;
@@ -23,7 +23,7 @@ using ::testing::Return;
using ::testing::SetArgumentPointee;
// When testing the floating drawing, we need to have a source of theme data.
-class MockThemeProvider : public ThemeProvider {
+class MockThemeProvider : public ui::ThemeProvider {
public:
// Cross platform methods
MOCK_METHOD1(Init, void(Profile*));
@@ -58,11 +58,11 @@ class MockThemeProvider : public ThemeProvider {
NSObject<BookmarkBarState, BookmarkBarToolbarViewController> {
@private
int currentTabContentsHeight_;
- ThemeProvider* themeProvider_;
+ ui::ThemeProvider* themeProvider_;
bookmarks::VisualState visualState_;
}
@property (nonatomic, assign) int currentTabContentsHeight;
-@property (nonatomic, assign) ThemeProvider* themeProvider;
+@property (nonatomic, assign) ui::ThemeProvider* themeProvider;
@property (nonatomic, assign) bookmarks::VisualState visualState;
// |BookmarkBarState| protocol:
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm
index 5083367..06a5443 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm
@@ -16,7 +16,7 @@
@interface BookmarkBarView (Private)
- (void)themeDidChangeNotification:(NSNotification*)aNotification;
-- (void)updateTheme:(ThemeProvider*)themeProvider;
+- (void)updateTheme:(ui::ThemeProvider*)themeProvider;
@end
@implementation BookmarkBarView
@@ -59,7 +59,7 @@
// controller desn't have access to it until it's placed in the view
// hierarchy. This is the spot where we close the loop.
- (void)viewWillMoveToWindow:(NSWindow*)window {
- ThemeProvider* themeProvider = [window themeProvider];
+ ui::ThemeProvider* themeProvider = [window themeProvider];
[self updateTheme:themeProvider];
[controller_ updateTheme:themeProvider];
}
@@ -70,14 +70,14 @@
// Called after the current theme has changed.
- (void)themeDidChangeNotification:(NSNotification*)aNotification {
- ThemeProvider* themeProvider =
- static_cast<ThemeProvider*>([[aNotification object] pointerValue]);
+ ui::ThemeProvider* themeProvider =
+ static_cast<ui::ThemeProvider*>([[aNotification object] pointerValue]);
[self updateTheme:themeProvider];
}
// Adapt appearance to the current theme. Called after theme changes and before
// this is shown for the first time.
-- (void)updateTheme:(ThemeProvider*)themeProvider {
+- (void)updateTheme:(ui::ThemeProvider*)themeProvider {
if (!themeProvider)
return;
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_button.h b/chrome/browser/ui/cocoa/bookmarks/bookmark_button.h
index 0bea5a5e..6525e8e 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button.h
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button.h
@@ -13,7 +13,10 @@ struct BookmarkNodeData;
class BookmarkModel;
class BookmarkNode;
@class BrowserWindowController;
+
+namespace ui {
class ThemeProvider;
+}
// Protocol for a BookmarkButton's delegate, responsible for doing
// things on behalf of a bookmark button.
@@ -115,7 +118,7 @@ class ThemeProvider;
- (CGFloat)indicatorPosForDragToPoint:(NSPoint)point;
// Return the theme provider associated with this browser window.
-- (ThemeProvider*)themeProvider;
+- (ui::ThemeProvider*)themeProvider;
// Called just before a child folder puts itself on screen.
- (void)childFolderWillShow:(id<BookmarkButtonControllerProtocol>)child;
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm
index c797992..7f9e616 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm
@@ -4,7 +4,6 @@
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.h"
-#include "app/text_elider.h"
#include "base/sys_string_conversions.h"
#include "base/utf_string_conversions.h"
#include "chrome/app/chrome_command_ids.h" // IDC_BOOKMARK_MENU
@@ -13,6 +12,7 @@
#include "chrome/browser/ui/browser.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.h"
#include "chrome/browser/ui/cocoa/event_utils.h"
+#include "ui/base/text/text_elider.h"
#include "webkit/glue/window_open_disposition.h"
namespace {
@@ -29,10 +29,10 @@ const NSUInteger kMaximumMenuPixelsWide = 300;
NSFont* nsfont = [NSFont menuBarFontOfSize:0]; // 0 means "default"
gfx::Font font(base::SysNSStringToUTF16([nsfont fontName]),
static_cast<int>([nsfont pointSize]));
- string16 title = gfx::ElideText(node->GetTitle(),
- font,
- kMaximumMenuPixelsWide,
- false);
+ string16 title = ui::ElideText(node->GetTitle(),
+ font,
+ kMaximumMenuPixelsWide,
+ false);
return base::SysUTF16ToNSString(title);
}
diff --git a/chrome/browser/ui/cocoa/browser_frame_view.mm b/chrome/browser/ui/cocoa/browser_frame_view.mm
index a966785..4b6980b 100644
--- a/chrome/browser/ui/cocoa/browser_frame_view.mm
+++ b/chrome/browser/ui/cocoa/browser_frame_view.mm
@@ -212,7 +212,7 @@ static BOOL gCanGetCornerRadius = NO;
bounds:(NSRect)bounds
offset:(NSPoint)offset
forceBlackBackground:(BOOL)forceBlackBackground {
- ThemeProvider* themeProvider = [[view window] themeProvider];
+ ui::ThemeProvider* themeProvider = [[view window] themeProvider];
if (!themeProvider)
return NO;
@@ -324,7 +324,7 @@ static BOOL gCanGetCornerRadius = NO;
}
+ (NSColor*)titleColorForThemeView:(NSView*)view {
- ThemeProvider* themeProvider = [[view window] themeProvider];
+ ui::ThemeProvider* themeProvider = [[view window] themeProvider];
if (!themeProvider)
return [NSColor windowFrameTextColor];
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.h b/chrome/browser/ui/cocoa/browser_window_controller.h
index 7c2347e..51424be 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.h
+++ b/chrome/browser/ui/cocoa/browser_window_controller.h
@@ -245,7 +245,7 @@ class TabContents;
- (void)updateSidebarForContents:(TabContents*)contents;
// Gets the current theme provider.
-- (ThemeProvider*)themeProvider;
+- (ui::ThemeProvider*)themeProvider;
// Gets the window style.
- (ThemedWindowStyle)themedWindowStyle;
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index d7207d6..d761f54 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -1477,7 +1477,7 @@
[[self window] setViewsNeedDisplay:YES];
}
-- (ThemeProvider*)themeProvider {
+- (ui::ThemeProvider*)themeProvider {
return browser_->profile()->GetThemeProvider();
}
diff --git a/chrome/browser/ui/cocoa/bubble_view.mm b/chrome/browser/ui/cocoa/bubble_view.mm
index a888ebc..0b92f39 100644
--- a/chrome/browser/ui/cocoa/bubble_view.mm
+++ b/chrome/browser/ui/cocoa/bubble_view.mm
@@ -74,7 +74,7 @@ const float kWindowEdge = 0.7f;
float bottomRightRadius =
cornerFlags_ & kRoundedBottomRightCorner ? kBubbleCornerRadius : 0;
- ThemeProvider* themeProvider =
+ ui::ThemeProvider* themeProvider =
themeProvider_ ? [themeProvider_ themeProvider] :
[[self window] themeProvider];
diff --git a/chrome/browser/ui/cocoa/chrome_browser_window.mm b/chrome/browser/ui/cocoa/chrome_browser_window.mm
index abac221..cceeb14 100644
--- a/chrome/browser/ui/cocoa/chrome_browser_window.mm
+++ b/chrome/browser/ui/cocoa/chrome_browser_window.mm
@@ -28,7 +28,7 @@
[self setOpaque:YES];
}
-- (ThemeProvider*)themeProvider {
+- (ui::ThemeProvider*)themeProvider {
id delegate = [self delegate];
if (![delegate respondsToSelector:@selector(themeProvider)])
return NULL;
diff --git a/chrome/browser/ui/cocoa/download/download_item_cell.h b/chrome/browser/ui/cocoa/download/download_item_cell.h
index a5ffaeb..0af75f26 100644
--- a/chrome/browser/ui/cocoa/download/download_item_cell.h
+++ b/chrome/browser/ui/cocoa/download/download_item_cell.h
@@ -45,7 +45,7 @@ enum DownloadItemMousePosition {
CGFloat statusAlpha_;
scoped_nsobject<NSAnimation> hideStatusAnimation_;
- scoped_ptr<ThemeProvider> themeProvider_;
+ scoped_ptr<ui::ThemeProvider> themeProvider_;
}
- (void)setStateFromDownload:(BaseDownloadItemModel*)downloadModel;
diff --git a/chrome/browser/ui/cocoa/download/download_item_cell.mm b/chrome/browser/ui/cocoa/download/download_item_cell.mm
index 586252d..e4d29e6 100644
--- a/chrome/browser/ui/cocoa/download/download_item_cell.mm
+++ b/chrome/browser/ui/cocoa/download/download_item_cell.mm
@@ -5,7 +5,6 @@
#import "chrome/browser/ui/cocoa/download/download_item_cell.h"
#include "app/l10n_util.h"
-#include "app/text_elider.h"
#include "base/sys_string_conversions.h"
#include "chrome/browser/download/download_item.h"
#include "chrome/browser/download/download_item_model.h"
@@ -19,6 +18,7 @@
#include "grit/theme_resources.h"
#import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h"
#import "third_party/GTM/AppKit/GTMNSColor+Luminance.h"
+#include "ui/base/text/text_elider.h"
namespace {
@@ -85,9 +85,9 @@ const int kCompleteAnimationDuration = 2.5;
animationCurve:(NSAnimationCurve)animationCurve;
@end
-class BackgroundTheme : public ThemeProvider {
+class BackgroundTheme : public ui::ThemeProvider {
public:
- BackgroundTheme(ThemeProvider* provider);
+ BackgroundTheme(ui::ThemeProvider* provider);
virtual void Init(Profile* profile) { }
virtual SkBitmap* GetBitmapNamed(int id) const { return nil; }
@@ -103,13 +103,13 @@ public:
virtual NSGradient* GetNSGradient(int id) const;
private:
- ThemeProvider* provider_;
+ ui::ThemeProvider* provider_;
scoped_nsobject<NSGradient> buttonGradient_;
scoped_nsobject<NSGradient> buttonPressedGradient_;
scoped_nsobject<NSColor> borderColor_;
};
-BackgroundTheme::BackgroundTheme(ThemeProvider* provider) :
+BackgroundTheme::BackgroundTheme(ui::ThemeProvider* provider) :
provider_(provider) {
NSColor* bgColor = [NSColor colorWithCalibratedRed:241/255.0
green:245/255.0
@@ -168,7 +168,7 @@ NSGradient* BackgroundTheme::GetNSGradient(int id) const {
progressed:(NSAnimationProgress)progress;
- (NSString*)elideTitle:(int)availableWidth;
- (NSString*)elideStatus:(int)availableWidth;
-- (ThemeProvider*)backgroundThemeWrappingProvider:(ThemeProvider*)provider;
+- (ui::ThemeProvider*)backgroundThemeWrappingProvider:(ui::ThemeProvider*)provider;
- (BOOL)pressedWithDefaultThemeOnPart:(DownloadItemMousePosition)part;
- (NSColor*)titleColorForPart:(DownloadItemMousePosition)part;
- (void)drawSecondaryTitleInRect:(NSRect)innerFrame;
@@ -398,7 +398,7 @@ NSGradient* BackgroundTheme::GetNSGradient(int id) const {
[font pointSize]);
return base::SysUTF16ToNSString(
- ElideFilename(downloadPath_, font_chr, availableWidth));
+ ui::ElideFilename(downloadPath_, font_chr, availableWidth));
}
- (NSString*)elideStatus:(int)availableWidth {
@@ -406,14 +406,14 @@ NSGradient* BackgroundTheme::GetNSGradient(int id) const {
gfx::Font font_chr(base::SysNSStringToUTF16([font fontName]),
[font pointSize]);
- return base::SysUTF16ToNSString(ElideText(
+ return base::SysUTF16ToNSString(ui::ElideText(
base::SysNSStringToUTF16([self secondaryTitle]),
font_chr,
availableWidth,
false));
}
-- (ThemeProvider*)backgroundThemeWrappingProvider:(ThemeProvider*)provider {
+- (ui::ThemeProvider*)backgroundThemeWrappingProvider:(ui::ThemeProvider*)provider {
if (!themeProvider_.get()) {
themeProvider_.reset(new BackgroundTheme(provider));
}
@@ -423,7 +423,8 @@ NSGradient* BackgroundTheme::GetNSGradient(int id) const {
// Returns if |part| was pressed while the default theme was active.
- (BOOL)pressedWithDefaultThemeOnPart:(DownloadItemMousePosition)part {
- ThemeProvider* themeProvider = [[[self controlView] window] themeProvider];
+ ui::ThemeProvider* themeProvider =
+ [[[self controlView] window] themeProvider];
bool isDefaultTheme =
!themeProvider->HasCustomImage(IDR_THEME_BUTTON_BACKGROUND);
return isDefaultTheme && [self isHighlighted] && mousePosition_ == part;
@@ -431,7 +432,8 @@ NSGradient* BackgroundTheme::GetNSGradient(int id) const {
// Returns the text color that should be used to draw text on |part|.
- (NSColor*)titleColorForPart:(DownloadItemMousePosition)part {
- ThemeProvider* themeProvider = [[[self controlView] window] themeProvider];
+ ui::ThemeProvider* themeProvider =
+ [[[self controlView] window] themeProvider];
NSColor* themeTextColor =
themeProvider->GetNSColor(BrowserThemeProvider::COLOR_BOOKMARK_TEXT,
true);
@@ -480,7 +482,8 @@ NSGradient* BackgroundTheme::GetNSGradient(int id) const {
// with a background that looks like windows (some transparent white) if a
// theme is used. Use custom theme object with a white color gradient to trick
// the superclass into drawing what we want.
- ThemeProvider* themeProvider = [[[self controlView] window] themeProvider];
+ ui::ThemeProvider* themeProvider =
+ [[[self controlView] window] themeProvider];
bool isDefaultTheme =
!themeProvider->HasCustomImage(IDR_THEME_BUTTON_BACKGROUND);
diff --git a/chrome/browser/ui/cocoa/download/download_item_controller.mm b/chrome/browser/ui/cocoa/download/download_item_controller.mm
index 23603f8..80f96d8 100644
--- a/chrome/browser/ui/cocoa/download/download_item_controller.mm
+++ b/chrome/browser/ui/cocoa/download/download_item_controller.mm
@@ -6,7 +6,6 @@
#include "app/l10n_util_mac.h"
#include "app/resource_bundle.h"
-#include "app/text_elider.h"
#include "base/mac/mac_util.h"
#include "base/metrics/histogram.h"
#include "base/string16.h"
@@ -27,6 +26,7 @@
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h"
+#include "ui/base/text/text_elider.h"
namespace {
@@ -87,7 +87,7 @@ class DownloadShelfContextMenuMac : public DownloadShelfContextMenu {
@interface DownloadItemController (Private)
- (void)themeDidChangeNotification:(NSNotification*)aNotification;
-- (void)updateTheme:(ThemeProvider*)themeProvider;
+- (void)updateTheme:(ui::ThemeProvider*)themeProvider;
- (void)setState:(DownoadItemState)state;
@end
@@ -191,15 +191,15 @@ class DownloadShelfContextMenuMac : public DownloadShelfContextMenu {
// Elide giant extensions.
if (extension.length() > kFileNameMaxLength / 2) {
std::wstring wide_extension;
- gfx::ElideString(UTF8ToWide(extension), kFileNameMaxLength / 2,
- &wide_extension);
+ ui::ElideString(UTF8ToWide(extension), kFileNameMaxLength / 2,
+ &wide_extension);
extension = WideToUTF8(wide_extension);
}
// Rebuild the filename.extension.
std::wstring rootname = UTF8ToWide(filename.RemoveExtension().value());
- gfx::ElideString(rootname, kFileNameMaxLength - extension.length(),
- &rootname);
+ ui::ElideString(rootname, kFileNameMaxLength - extension.length(),
+ &rootname);
std::string new_filename = WideToUTF8(rootname);
if (extension.length())
new_filename += std::string(".") + extension;
@@ -269,7 +269,7 @@ class DownloadShelfContextMenuMac : public DownloadShelfContextMenu {
}
- (void)updateToolTip {
- string16 elidedFilename = gfx::ElideFilename(
+ string16 elidedFilename = ui::ElideFilename(
[self download]->GetFileNameToReportUser(),
gfx::Font(), kToolTipMaxWidth);
[progressView_ setToolTip:base::SysUTF16ToNSString(elidedFilename)];
@@ -306,14 +306,14 @@ class DownloadShelfContextMenuMac : public DownloadShelfContextMenu {
// Called after the current theme has changed.
- (void)themeDidChangeNotification:(NSNotification*)aNotification {
- ThemeProvider* themeProvider =
- static_cast<ThemeProvider*>([[aNotification object] pointerValue]);
+ ui::ThemeProvider* themeProvider =
+ static_cast<ui::ThemeProvider*>([[aNotification object] pointerValue]);
[self updateTheme:themeProvider];
}
// Adapt appearance to the current theme. Called after theme changes and before
// this is shown for the first time.
-- (void)updateTheme:(ThemeProvider*)themeProvider {
+- (void)updateTheme:(ui::ThemeProvider*)themeProvider {
NSColor* color =
themeProvider->GetNSColor(BrowserThemeProvider::COLOR_TAB_TEXT, true);
[dangerousDownloadLabel_ setTextColor:color];
diff --git a/chrome/browser/ui/cocoa/download/download_shelf_controller.mm b/chrome/browser/ui/cocoa/download/download_shelf_controller.mm
index f88071f..bede2d6 100644
--- a/chrome/browser/ui/cocoa/download/download_shelf_controller.mm
+++ b/chrome/browser/ui/cocoa/download/download_shelf_controller.mm
@@ -161,7 +161,8 @@ const NSTimeInterval kAutoCloseDelaySeconds = 5;
NSColor* color = nil;
if (bridge_.get() && bridge_->browser() && bridge_->browser()->profile()) {
- ThemeProvider* provider = bridge_->browser()->profile()->GetThemeProvider();
+ ui::ThemeProvider* provider =
+ bridge_->browser()->profile()->GetThemeProvider();
color =
provider->GetNSColor(BrowserThemeProvider::COLOR_BOOKMARK_TEXT, false);
diff --git a/chrome/browser/ui/cocoa/download/download_shelf_view.mm b/chrome/browser/ui/cocoa/download/download_shelf_view.mm
index f3840ef..55b88d5 100644
--- a/chrome/browser/ui/cocoa/download/download_shelf_view.mm
+++ b/chrome/browser/ui/cocoa/download/download_shelf_view.mm
@@ -14,7 +14,7 @@
- (NSColor*)strokeColor {
BOOL isKey = [[self window] isKeyWindow];
- ThemeProvider* themeProvider = [[self window] themeProvider];
+ ui::ThemeProvider* themeProvider = [[self window] themeProvider];
return themeProvider ? themeProvider->GetNSColor(
isKey ? BrowserThemeProvider::COLOR_TOOLBAR_STROKE :
BrowserThemeProvider::COLOR_TOOLBAR_STROKE_INACTIVE, true) :
@@ -23,7 +23,7 @@
- (void)drawRect:(NSRect)rect {
BOOL isKey = [[self window] isKeyWindow];
- ThemeProvider* themeProvider = [[self window] themeProvider];
+ ui::ThemeProvider* themeProvider = [[self window] themeProvider];
if (!themeProvider)
return;
diff --git a/chrome/browser/ui/cocoa/external_protocol_dialog.mm b/chrome/browser/ui/cocoa/external_protocol_dialog.mm
index e72394b..09985c4 100644
--- a/chrome/browser/ui/cocoa/external_protocol_dialog.mm
+++ b/chrome/browser/ui/cocoa/external_protocol_dialog.mm
@@ -5,7 +5,6 @@
#import "chrome/browser/ui/cocoa/external_protocol_dialog.h"
#include "app/l10n_util_mac.h"
-#include "app/text_elider.h"
#include "base/message_loop.h"
#include "base/metrics/histogram.h"
#include "base/string_util.h"
@@ -14,6 +13,7 @@
#include "chrome/browser/external_protocol_handler.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
+#include "ui/base/text/text_elider.h"
///////////////////////////////////////////////////////////////////////////////
// ExternalProtocolHandler
@@ -62,8 +62,8 @@ void ExternalProtocolHandler::RunExternalProtocolDialog(
const int kMaxUrlWithoutSchemeSize = 256;
std::wstring elided_url_without_scheme;
- gfx::ElideString(ASCIIToWide(url_.possibly_invalid_spec()),
- kMaxUrlWithoutSchemeSize, &elided_url_without_scheme);
+ ui::ElideString(ASCIIToWide(url_.possibly_invalid_spec()),
+ kMaxUrlWithoutSchemeSize, &elided_url_without_scheme);
NSString* urlString = l10n_util::GetNSStringFWithFixup(
IDS_EXTERNAL_PROTOCOL_INFORMATION,
diff --git a/chrome/browser/ui/cocoa/gradient_button_cell.h b/chrome/browser/ui/cocoa/gradient_button_cell.h
index a1e905f..48929b5 100644
--- a/chrome/browser/ui/cocoa/gradient_button_cell.h
+++ b/chrome/browser/ui/cocoa/gradient_button_cell.h
@@ -10,7 +10,9 @@
#include "base/scoped_nsobject.h"
+namespace ui {
class ThemeProvider;
+}
// Base class for button cells for toolbar and bookmark bar.
//
@@ -68,7 +70,7 @@ typedef enum {
// Turn off theming. Temporary work-around.
- (void)setShouldTheme:(BOOL)shouldTheme;
-- (void)drawBorderAndFillForTheme:(ThemeProvider*)themeProvider
+- (void)drawBorderAndFillForTheme:(ui::ThemeProvider*)themeProvider
controlView:(NSView*)controlView
innerPath:(NSBezierPath*)innerPath
showClickedGradient:(BOOL)showClickedGradient
diff --git a/chrome/browser/ui/cocoa/gradient_button_cell.mm b/chrome/browser/ui/cocoa/gradient_button_cell.mm
index 459aa8e..ce2ea01 100644
--- a/chrome/browser/ui/cocoa/gradient_button_cell.mm
+++ b/chrome/browser/ui/cocoa/gradient_button_cell.mm
@@ -336,7 +336,7 @@ static const NSTimeInterval kAnimationContinuousCycleDuration = 0.4;
}
// TODO(viettrungluu): clean up/reorganize.
-- (void)drawBorderAndFillForTheme:(ThemeProvider*)themeProvider
+- (void)drawBorderAndFillForTheme:(ui::ThemeProvider*)themeProvider
controlView:(NSView*)controlView
innerPath:(NSBezierPath*)innerPath
showClickedGradient:(BOOL)showClickedGradient
@@ -516,7 +516,7 @@ static const NSTimeInterval kAnimationContinuousCycleDuration = 0.4;
BOOL pressed = ([((NSControl*)[self controlView]) isEnabled] &&
[self isHighlighted]);
NSWindow* window = [controlView window];
- ThemeProvider* themeProvider = [window themeProvider];
+ ui::ThemeProvider* themeProvider = [window themeProvider];
BOOL active = [window isKeyWindow] || [window isMainWindow];
// Stroke the borders and appropriate fill gradient. If we're borderless, the
diff --git a/chrome/browser/ui/cocoa/infobars/infobar_gradient_view.mm b/chrome/browser/ui/cocoa/infobars/infobar_gradient_view.mm
index d6a0714..114f2c6 100644
--- a/chrome/browser/ui/cocoa/infobars/infobar_gradient_view.mm
+++ b/chrome/browser/ui/cocoa/infobars/infobar_gradient_view.mm
@@ -39,7 +39,7 @@ const double kBackgroundColorBottom[3] =
}
- (NSColor*)strokeColor {
- ThemeProvider* themeProvider = [[self window] themeProvider];
+ ui::ThemeProvider* themeProvider = [[self window] themeProvider];
if (!themeProvider)
return [NSColor blackColor];
diff --git a/chrome/browser/ui/cocoa/js_modal_dialog_cocoa.mm b/chrome/browser/ui/cocoa/js_modal_dialog_cocoa.mm
index 219c448..e0fd72c 100644
--- a/chrome/browser/ui/cocoa/js_modal_dialog_cocoa.mm
+++ b/chrome/browser/ui/cocoa/js_modal_dialog_cocoa.mm
@@ -7,7 +7,6 @@
#import <Cocoa/Cocoa.h>
#include "app/l10n_util_mac.h"
-#include "app/message_box_flags.h"
#include "base/logging.h"
#import "base/mac/cocoa_protocols.h"
#include "base/sys_string_conversions.h"
@@ -15,6 +14,7 @@
#include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h"
#include "grit/app_strings.h"
#include "grit/generated_resources.h"
+#include "ui/base/message_box_flags.h"
// Helper object that receives the notification that the dialog/sheet is
// going away. Is responsible for cleaning itself up.
@@ -106,10 +106,10 @@ JSModalDialogCocoa::JSModalDialogCocoa(JavaScriptAppModalDialog* dialog)
bool text_field = false;
bool one_button = false;
switch (dialog_->dialog_flags()) {
- case MessageBoxFlags::kIsJavascriptAlert:
+ case ui::MessageBoxFlags::kIsJavascriptAlert:
one_button = true;
break;
- case MessageBoxFlags::kIsJavascriptConfirm:
+ case ui::MessageBoxFlags::kIsJavascriptConfirm:
if (dialog_->is_before_unload_dialog()) {
default_button = l10n_util::GetNSStringWithFixup(
IDS_BEFOREUNLOAD_MESSAGEBOX_OK_BUTTON_LABEL);
@@ -117,7 +117,7 @@ JSModalDialogCocoa::JSModalDialogCocoa(JavaScriptAppModalDialog* dialog)
IDS_BEFOREUNLOAD_MESSAGEBOX_CANCEL_BUTTON_LABEL);
}
break;
- case MessageBoxFlags::kIsJavascriptPrompt:
+ case ui::MessageBoxFlags::kIsJavascriptPrompt:
text_field = true;
break;
@@ -166,10 +166,10 @@ int JSModalDialogCocoa::GetAppModalDialogButtons() const {
int num_buttons = [[alert_ buttons] count];
switch (num_buttons) {
case 1:
- return MessageBoxFlags::DIALOGBUTTON_OK;
+ return ui::MessageBoxFlags::DIALOGBUTTON_OK;
case 2:
- return MessageBoxFlags::DIALOGBUTTON_OK |
- MessageBoxFlags::DIALOGBUTTON_CANCEL;
+ return ui::MessageBoxFlags::DIALOGBUTTON_OK |
+ ui::MessageBoxFlags::DIALOGBUTTON_CANCEL;
default:
NOTREACHED();
return 0;
diff --git a/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.mm b/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.mm
index 79d794b..745e64c 100644
--- a/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.mm
@@ -4,12 +4,12 @@
#import "chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.h"
-#include "app/text_elider.h"
#import "base/logging.h"
#include "base/sys_string_conversions.h"
#import "chrome/browser/ui/cocoa/image_utils.h"
#import "chrome/browser/ui/cocoa/location_bar/location_icon_decoration.h"
#include "gfx/font.h"
+#include "ui/base/text/text_elider.h"
namespace {
@@ -92,7 +92,8 @@ CGFloat EVBubbleDecoration::GetWidthForSpace(CGFloat width) {
gfx::Font font(base::SysNSStringToUTF16([font_ fontName]),
[font_ pointSize]);
NSString* elided_label = base::SysUTF16ToNSString(
- ElideText(base::SysNSStringToUTF16(full_label_), font, width_left, true));
+ ui::ElideText(base::SysNSStringToUTF16(full_label_), font, width_left,
+ true));
// Use the elided label.
SetLabel(elided_label);
diff --git a/chrome/browser/ui/cocoa/status_bubble_mac.mm b/chrome/browser/ui/cocoa/status_bubble_mac.mm
index ffc0cb9..93837a2 100644
--- a/chrome/browser/ui/cocoa/status_bubble_mac.mm
+++ b/chrome/browser/ui/cocoa/status_bubble_mac.mm
@@ -6,7 +6,6 @@
#include <limits>
-#include "app/text_elider.h"
#include "base/compiler_specific.h"
#include "base/message_loop.h"
#include "base/string_util.h"
@@ -18,6 +17,7 @@
#import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h"
#import "third_party/GTM/AppKit/GTMNSBezierPath+RoundRect.h"
#import "third_party/GTM/AppKit/GTMNSColor+Luminance.h"
+#include "ui/base/text/text_elider.h"
namespace {
@@ -152,7 +152,7 @@ void StatusBubbleMac::SetURL(const GURL& url, const string16& languages) {
[font pointSize]);
string16 original_url_text = net::FormatUrl(url, UTF16ToUTF8(languages));
- string16 status = gfx::ElideUrl(url, font_chr, text_width,
+ string16 status = ui::ElideUrl(url, font_chr, text_width,
UTF16ToWideHack(languages));
SetText(status, true);
@@ -608,7 +608,7 @@ void StatusBubbleMac::ExpandBubble() {
NSFont* font = [[window_ contentView] font];
gfx::Font font_chr(base::SysNSStringToUTF16([font fontName]),
[font pointSize]);
- string16 expanded_url = gfx::ElideUrl(url_, font_chr,
+ string16 expanded_url = ui::ElideUrl(url_, font_chr,
max_bubble_width, UTF16ToWideHack(languages_));
// Scale width from gfx::Font in view coordinates to window coordinates.
diff --git a/chrome/browser/ui/cocoa/tabs/tab_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_controller.mm
index 518ef21..e28e7fc 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_controller.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_controller.mm
@@ -268,7 +268,7 @@ class MenuDelegate : public ui::SimpleMenuModel::Delegate {
- (void)updateTitleColor {
NSColor* titleColor = nil;
- ThemeProvider* theme = [[[self view] window] themeProvider];
+ ui::ThemeProvider* theme = [[[self view] window] themeProvider];
if (theme && ![self selected]) {
titleColor =
theme->GetNSColor(BrowserThemeProvider::COLOR_BACKGROUND_TAB_TEXT,
diff --git a/chrome/browser/ui/cocoa/tabs/tab_view.mm b/chrome/browser/ui/cocoa/tabs/tab_view.mm
index d5a2de2..7e27302 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_view.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_view.mm
@@ -644,7 +644,7 @@ const CGFloat kRapidCloseDist = 2.5;
// background overlay drawn over it (see below) will be fully opaque.
BOOL hasBackgroundImage = NO;
if (!selected) {
- // ThemeProvider::HasCustomImage is true only if the theme provides the
+ // ui::ThemeProvider::HasCustomImage is true only if the theme provides the
// image. However, even if the theme doesn't provide a tab background, the
// theme machinery will make one if given a frame image. See
// BrowserThemePack::GenerateTabBackgroundImages for details.
diff --git a/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm
index 25d8468..5497eda 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm
@@ -4,11 +4,11 @@
#import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h"
-#include "app/theme_provider.h"
#include "base/logging.h"
#import "chrome/browser/ui/cocoa/focus_tracker.h"
#import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h"
#import "chrome/browser/ui/cocoa/themed_window.h"
+#include "ui/base/theme_provider.h"
@interface TabWindowController(PRIVATE)
- (void)setUseOverlay:(BOOL)useOverlay;
@@ -19,7 +19,7 @@
@implementation TabWindowOverlayWindow
-- (ThemeProvider*)themeProvider {
+- (ui::ThemeProvider*)themeProvider {
if ([self parentWindow])
return [[[self parentWindow] windowController] themeProvider];
return NULL;
diff --git a/chrome/browser/ui/cocoa/themed_window.h b/chrome/browser/ui/cocoa/themed_window.h
index d35bfa3..4da0d53 100644
--- a/chrome/browser/ui/cocoa/themed_window.h
+++ b/chrome/browser/ui/cocoa/themed_window.h
@@ -8,7 +8,10 @@
#import <Cocoa/Cocoa.h>
+namespace ui {
class ThemeProvider;
+}
+using ui::ThemeProvider;
// Bit flags; mix-and-match as necessary.
enum {