summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/cocoa/bookmarks
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-20 18:27:06 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-20 18:27:06 +0000
commit9dd7e3d78c14f67c5c3d78868a3a63bbc4f90634 (patch)
tree3b7332926a05a1c8382eb27422c385b56b29cb24 /chrome/browser/ui/cocoa/bookmarks
parenta12f7fbe12afffb4b1b31ec0d6b0988f1f9a6554 (diff)
downloadchromium_src-9dd7e3d78c14f67c5c3d78868a3a63bbc4f90634.zip
chromium_src-9dd7e3d78c14f67c5c3d78868a3a63bbc4f90634.tar.gz
chromium_src-9dd7e3d78c14f67c5c3d78868a3a63bbc4f90634.tar.bz2
Move a bunch of random other files to src/ui/base
BUG=none TEST=none TBR=brettw Review URL: http://codereview.chromium.org/6257006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71970 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/cocoa/bookmarks')
-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
10 files changed, 33 insertions, 27 deletions
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);
}