diff options
25 files changed, 68 insertions, 78 deletions
diff --git a/app/app_base.gypi b/app/app_base.gypi index 0dad137..5794c7d 100644 --- a/app/app_base.gypi +++ b/app/app_base.gypi @@ -26,9 +26,6 @@ 'sources': [ 'app_paths.h', 'app_paths.cc', - 'mac/nsimage_cache.h', - 'mac/nsimage_cache.mm', - 'mac/scoped_nsdisable_screen_updates.h', 'sql/connection.cc', 'sql/connection.h', 'sql/diagnostic_error_delegate.h', diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm index 3d0769f..bea0249 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm @@ -4,7 +4,6 @@ #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" -#include "app/mac/nsimage_cache.h" #include "base/mac/mac_util.h" #include "base/metrics/histogram.h" #include "base/sys_string_conversions.h" @@ -51,6 +50,7 @@ #include "ui/base/l10n/l10n_util_mac.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/image/image.h" +#include "ui/gfx/mac/nsimage_cache.h" // Bookmark bar state changing and animations // @@ -243,7 +243,7 @@ void RecordAppLaunch(Profile* profile, GURL url) { ResourceBundle& rb = ResourceBundle::GetSharedInstance(); folderImage_.reset( [rb.GetNativeImageNamed(IDR_BOOKMARK_BAR_FOLDER) retain]); - defaultImage_.reset([app::mac::GetCachedImageWithName(@"nav.pdf") retain]); + defaultImage_.reset([gfx::GetCachedImageWithName(@"nav.pdf") retain]); // Register for theme changes, bookmark button pulsing, ... NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter]; diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm index 32c0e56..2add752 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm @@ -4,16 +4,16 @@ #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h" -#include "app/mac/nsimage_cache.h" #include "base/logging.h" #include "base/sys_string_conversions.h" #import "chrome/browser/bookmarks/bookmark_model.h" -#import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu.h" #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" +#import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu.h" #import "chrome/browser/ui/cocoa/image_utils.h" #include "content/browser/user_metrics.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util_mac.h" +#include "ui/gfx/mac/nsimage_cache.h" @interface BookmarkButtonCell(Private) @@ -208,7 +208,7 @@ drawFolderArrow_ = draw; if (draw && !arrowImage_) { arrowImage_.reset( - [app::mac::GetCachedImageWithName(@"menu_hierarchy_arrow.pdf") retain]); + [gfx::GetCachedImageWithName(@"menu_hierarchy_arrow.pdf") retain]); } } diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell_unittest.mm index 7894a9e..3269403 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell_unittest.mm @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "app/mac/nsimage_cache.h" #include "base/memory/scoped_nsobject.h" #include "base/utf_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_model.h" @@ -13,6 +12,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" #include "ui/gfx/image/image.h" +#include "ui/gfx/mac/nsimage_cache.h" // Simple class to remember how many mouseEntered: and mouseExited: // calls it gets. Only used by BookmarkMouseForwarding but placed @@ -66,7 +66,7 @@ TEST_F(BookmarkButtonCellTest, IconOnlySqueeze) { [[test_window() contentView] addSubview:view]; scoped_nsobject<NSImage> image( - [app::mac::GetCachedImageWithName(@"nav.pdf") retain]); + [gfx::GetCachedImageWithName(@"nav.pdf") retain]); EXPECT_TRUE(image.get()); NSRect r = NSMakeRect(0, 0, 100, 100); diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm index 3b52c0a..c5c1f38 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm @@ -4,7 +4,6 @@ #import <AppKit/AppKit.h> -#include "app/mac/nsimage_cache.h" #include "base/sys_string_conversions.h" #include "chrome/app/chrome_command_ids.h" #import "chrome/browser/app_controller_mac.h" @@ -20,6 +19,7 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/image/image.h" +#include "ui/gfx/mac/nsimage_cache.h" BookmarkMenuBridge::BookmarkMenuBridge(Profile* profile) : menuIsValid_(false), @@ -298,7 +298,7 @@ void BookmarkMenuBridge::ConfigureMenuItem(const BookmarkNode* node, // Either we do not have a loaded favicon or the conversion from SkBitmap // failed. Use the default site image instead. if (!favicon) - favicon = app::mac::GetCachedImageWithName(@"nav.pdf"); + favicon = gfx::GetCachedImageWithName(@"nav.pdf"); [item setImage:favicon]; } diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm index 6a540c6..449a438 100644 --- a/chrome/browser/ui/cocoa/browser_window_controller.mm +++ b/chrome/browser/ui/cocoa/browser_window_controller.mm @@ -6,8 +6,6 @@ #include <Carbon/Carbon.h> -#include "app/mac/scoped_nsdisable_screen_updates.h" -#include "app/mac/nsimage_cache.h" #include "base/mac/mac_util.h" #import "base/memory/scoped_nsobject.h" #include "base/sys_string_conversions.h" @@ -46,10 +44,10 @@ #import "chrome/browser/ui/cocoa/tab_contents/previewable_contents_controller.h" #import "chrome/browser/ui/cocoa/tab_contents/sad_tab_controller.h" #import "chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.h" +#import "chrome/browser/ui/cocoa/tabpose_window.h" #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" #import "chrome/browser/ui/cocoa/tabs/tab_view.h" -#import "chrome/browser/ui/cocoa/tabpose_window.h" #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" #include "chrome/browser/ui/omnibox/location_bar.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" @@ -63,6 +61,8 @@ #include "grit/locale_settings.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util_mac.h" +#include "ui/gfx/mac/nsimage_cache.h" +#include "ui/gfx/mac/scoped_ns_disable_screen_updates.h" #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" @@ -542,7 +542,7 @@ // going away) will again call to close the window when it's finally ready. - (BOOL)windowShouldClose:(id)sender { // Disable updates while closing all tabs to avoid flickering. - app::mac::ScopedNSDisableScreenUpdates disabler; + gfx::ScopedNSDisableScreenUpdates disabler; // Give beforeunload handlers the chance to cancel the close before we hide // the window below. if (!browser_->ShouldCloseWindow()) @@ -1244,7 +1244,7 @@ - (TabWindowController*)detachTabToNewWindow:(TabView*)tabView { // Disable screen updates so that this appears as a single visual change. - app::mac::ScopedNSDisableScreenUpdates disabler; + gfx::ScopedNSDisableScreenUpdates disabler; // Fetch the tab contents for the tab being dragged. int index = [tabStripController_ modelIndexForTabView:tabView]; @@ -1644,7 +1644,7 @@ // Install the image into the badge view and size the view appropriately. // Hide it for now; positioning and showing will be done by the layout code. - NSImage* image = app::mac::GetCachedImageWithName(@"otr_icon.pdf"); + NSImage* image = gfx::GetCachedImageWithName(@"otr_icon.pdf"); incognitoBadge_.reset([[IncognitoImageView alloc] init]); [incognitoBadge_ setImage:image]; [incognitoBadge_ setFrameSize:[image size]]; diff --git a/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm b/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm index b07ceb8..342c59c 100644 --- a/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm +++ b/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm @@ -7,7 +7,6 @@ #include <cmath> #include <string> -#include "app/mac/nsimage_cache.h" #include "base/sys_string_conversions.h" #include "chrome/browser/extensions/extension_browser_event_router.h" #include "chrome/browser/extensions/extension_service.h" @@ -16,13 +15,13 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sessions/restore_tab_helper.h" #include "chrome/browser/ui/browser.h" -#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #import "chrome/browser/ui/cocoa/extensions/browser_action_button.h" #import "chrome/browser/ui/cocoa/extensions/browser_actions_container_view.h" #import "chrome/browser/ui/cocoa/extensions/chevron_menu_button.h" #import "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h" #import "chrome/browser/ui/cocoa/image_button_cell.h" #import "chrome/browser/ui/cocoa/menu_button.h" +#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/common/extensions/extension_action.h" #include "chrome/common/pref_names.h" #include "content/browser/tab_contents/tab_contents.h" @@ -33,6 +32,7 @@ #include "grit/theme_resources.h" #include "grit/theme_resources_standard.h" #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" +#include "ui/gfx/mac/nsimage_cache.h" NSString* const kBrowserActionVisibilityChangedNotification = @"BrowserActionVisibilityChangedNotification"; diff --git a/chrome/browser/ui/cocoa/history_menu_bridge.mm b/chrome/browser/ui/cocoa/history_menu_bridge.mm index 37511d9..1fd1198 100644 --- a/chrome/browser/ui/cocoa/history_menu_bridge.mm +++ b/chrome/browser/ui/cocoa/history_menu_bridge.mm @@ -4,7 +4,6 @@ #include "chrome/browser/ui/cocoa/history_menu_bridge.h" -#include "app/mac/nsimage_cache.h" #include "base/callback.h" #include "base/stl_util-inl.h" #include "base/string_number_conversions.h" @@ -29,6 +28,7 @@ #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/codec/png_codec.h" #include "ui/gfx/image/image.h" +#include "ui/gfx/mac/nsimage_cache.h" namespace { @@ -93,7 +93,7 @@ HistoryMenuBridge::HistoryMenuBridge(Profile* profile) } ResourceBundle& rb = ResourceBundle::GetSharedInstance(); - default_favicon_.reset([app::mac::GetCachedImageWithName(@"nav.pdf") retain]); + default_favicon_.reset([gfx::GetCachedImageWithName(@"nav.pdf") retain]); // Set the static icons in the menu. NSMenuItem* item = [HistoryMenu() itemWithTag:IDC_SHOW_HISTORY]; diff --git a/chrome/browser/ui/cocoa/hung_renderer_controller.mm b/chrome/browser/ui/cocoa/hung_renderer_controller.mm index 25092a9..9d6f6b8 100644 --- a/chrome/browser/ui/cocoa/hung_renderer_controller.mm +++ b/chrome/browser/ui/cocoa/hung_renderer_controller.mm @@ -6,7 +6,6 @@ #import <Cocoa/Cocoa.h> -#include "app/mac/nsimage_cache.h" #include "base/mac/mac_util.h" #include "base/process_util.h" #include "base/sys_string_conversions.h" @@ -14,12 +13,12 @@ #include "chrome/browser/ui/browser_dialogs.h" #include "chrome/browser/ui/browser_list.h" #import "chrome/browser/ui/cocoa/multi_key_equivalent_button.h" +#import "chrome/browser/ui/cocoa/tab_contents/favicon_util.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/common/logging_chrome.h" #include "content/browser/renderer_host/render_process_host.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/tab_contents/tab_contents.h" -#import "chrome/browser/ui/cocoa/tab_contents/favicon_util.h" #include "content/common/result_codes.h" #include "grit/app_resources.h" #include "grit/chromium_strings.h" @@ -35,7 +34,7 @@ namespace { // We only support showing one of these at a time per app. The // controller owns itself and is released when its window is closed. HungRendererController* g_instance = NULL; -} // end namespace +} // namespace @implementation HungRendererController diff --git a/chrome/browser/ui/cocoa/notifications/balloon_controller.mm b/chrome/browser/ui/cocoa/notifications/balloon_controller.mm index dec0b90..b45838d 100644 --- a/chrome/browser/ui/cocoa/notifications/balloon_controller.mm +++ b/chrome/browser/ui/cocoa/notifications/balloon_controller.mm @@ -4,7 +4,6 @@ #include "chrome/browser/ui/cocoa/notifications/balloon_controller.h" -#include "app/mac/nsimage_cache.h" #import "base/mac/cocoa_protocols.h" #include "base/mac/mac_util.h" #import "base/memory/scoped_nsobject.h" @@ -24,6 +23,7 @@ #include "grit/theme_resources.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" +#include "ui/gfx/mac/nsimage_cache.h" namespace { @@ -60,7 +60,7 @@ const int kRightMargin = 2; DCHECK([self window]); DCHECK_EQ(self, [[self window] delegate]); - NSImage* image = app::mac::GetCachedImageWithName(@"balloon_wrench.pdf"); + NSImage* image = gfx::GetCachedImageWithName(@"balloon_wrench.pdf"); [optionsButton_ setDefaultImage:image]; [optionsButton_ setDefaultOpacity:0.6]; [optionsButton_ setHoverImage:image]; diff --git a/chrome/browser/ui/cocoa/nsimage_cache_unittest.mm b/chrome/browser/ui/cocoa/nsimage_cache_unittest.mm index b3c336a..15175c1 100644 --- a/chrome/browser/ui/cocoa/nsimage_cache_unittest.mm +++ b/chrome/browser/ui/cocoa/nsimage_cache_unittest.mm @@ -1,16 +1,16 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #import <Cocoa/Cocoa.h> -#include "app/mac/nsimage_cache.h" #include "base/file_path.h" #include "base/mac/mac_util.h" #include "base/path_service.h" #include "chrome/common/chrome_constants.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" +#include "ui/gfx/mac/nsimage_cache.h" // This tests nsimage_cache, which lives in base/. The unit test is in // chrome/ because it depends on having a built-up Chrome present. @@ -32,30 +32,30 @@ class NSImageCacheTest : public PlatformTest { }; TEST_F(NSImageCacheTest, LookupFound) { - EXPECT_TRUE(app::mac::GetCachedImageWithName(@"product_logo_32.png") != nil) + EXPECT_TRUE(gfx::GetCachedImageWithName(@"product_logo_32.png") != nil) << "Failed to find the toolbar image?"; } TEST_F(NSImageCacheTest, LookupCached) { - EXPECT_EQ(app::mac::GetCachedImageWithName(@"product_logo_32.png"), - app::mac::GetCachedImageWithName(@"product_logo_32.png")) + EXPECT_EQ(gfx::GetCachedImageWithName(@"product_logo_32.png"), + gfx::GetCachedImageWithName(@"product_logo_32.png")) << "Didn't get the same NSImage back?"; } TEST_F(NSImageCacheTest, LookupMiss) { - EXPECT_TRUE(app::mac::GetCachedImageWithName(@"should_not.exist") == nil) + EXPECT_TRUE(gfx::GetCachedImageWithName(@"should_not.exist") == nil) << "There shouldn't be an image with this name?"; } TEST_F(NSImageCacheTest, LookupFoundAndClear) { - NSImage *first = app::mac::GetCachedImageWithName(@"product_logo_32.png"); + NSImage *first = gfx::GetCachedImageWithName(@"product_logo_32.png"); // Hang on to the first image so that the second one doesn't get allocated // in the same location by (bad) luck. [[first retain] autorelease]; EXPECT_TRUE(first != nil) << "Failed to find the toolbar image?"; - app::mac::ClearCachedImages(); - NSImage *second = app::mac::GetCachedImageWithName(@"product_logo_32.png"); + gfx::ClearCachedImages(); + NSImage *second = gfx::GetCachedImageWithName(@"product_logo_32.png"); EXPECT_TRUE(second != nil) << "Failed to find the toolbar image...again?"; EXPECT_NE(second, first) @@ -64,11 +64,11 @@ TEST_F(NSImageCacheTest, LookupFoundAndClear) { TEST_F(NSImageCacheTest, AutoTemplating) { NSImage *templateImage = - app::mac::GetCachedImageWithName(@"find_next_Template.pdf"); + gfx::GetCachedImageWithName(@"find_next_Template.pdf"); EXPECT_TRUE([templateImage isTemplate] == YES) << "Image ending in 'Template' should be marked as being a template"; NSImage *nonTemplateImage = - app::mac::GetCachedImageWithName(@"aliasCursor.png"); + gfx::GetCachedImageWithName(@"aliasCursor.png"); EXPECT_FALSE([nonTemplateImage isTemplate] == YES) << "Image not ending in 'Template' should not be marked as being a " "template"; diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm index b614c91..7f86522 100644 --- a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm +++ b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm @@ -6,7 +6,6 @@ #include <Carbon/Carbon.h> // kVK_Return -#include "app/mac/nsimage_cache.h" #include "base/string_util.h" #include "base/sys_string_conversions.h" #include "base/utf_string_conversions.h" @@ -26,6 +25,7 @@ #include "ui/base/clipboard/clipboard.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/image/image.h" +#include "ui/gfx/mac/nsimage_cache.h" #include "ui/gfx/rect.h" // Focus-handling between |field_| and |model_| is a bit subtle. @@ -156,7 +156,7 @@ NSImage* OmniboxViewMac::ImageForResource(int resource_id) { } if (image_name) { - if (NSImage* image = app::mac::GetCachedImageWithName(image_name)) { + if (NSImage* image = gfx::GetCachedImageWithName(image_name)) { return image; } else { NOTREACHED() diff --git a/chrome/browser/ui/cocoa/tab_contents/favicon_util.mm b/chrome/browser/ui/cocoa/tab_contents/favicon_util.mm index 580f9ca..ff5cc74 100644 --- a/chrome/browser/ui/cocoa/tab_contents/favicon_util.mm +++ b/chrome/browser/ui/cocoa/tab_contents/favicon_util.mm @@ -6,11 +6,11 @@ #import <AppKit/AppKit.h> -#include "app/mac/nsimage_cache.h" #include "base/mac/mac_util.h" #include "chrome/browser/favicon/favicon_tab_helper.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "skia/ext/skia_utils_mac.h" +#include "ui/gfx/mac/nsimage_cache.h" namespace mac { @@ -29,7 +29,7 @@ NSImage* FaviconForTabContents(TabContentsWrapper* contents) { } } - return app::mac::GetCachedImageWithName(@"nav.pdf"); + return gfx::GetCachedImageWithName(@"nav.pdf"); } } // namespace mac diff --git a/chrome/browser/ui/cocoa/tab_contents/web_contents_drag_source.mm b/chrome/browser/ui/cocoa/tab_contents/web_contents_drag_source.mm index d1e4a9b..524a855 100644 --- a/chrome/browser/ui/cocoa/tab_contents/web_contents_drag_source.mm +++ b/chrome/browser/ui/cocoa/tab_contents/web_contents_drag_source.mm @@ -1,15 +1,15 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #import "chrome/browser/ui/cocoa/tab_contents/web_contents_drag_source.h" -#include "app/mac/nsimage_cache.h" #include "base/string_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/tab_contents/tab_contents_view_mac.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/tab_contents/tab_contents.h" +#include "ui/gfx/mac/nsimage_cache.h" namespace { @@ -20,7 +20,7 @@ NSImage* MakeDragImage() { // WebKit/WebKit/mac/Misc/WebNSViewExtras.m: |-_web_DragImageForElement:...|). // Default to returning a generic image. - return app::mac::GetCachedImageWithName(@"nav.pdf"); + return gfx::GetCachedImageWithName(@"nav.pdf"); } // Flips screen and point coordinates over the y axis to work with webkit diff --git a/chrome/browser/ui/cocoa/tab_contents/web_drag_source.mm b/chrome/browser/ui/cocoa/tab_contents/web_drag_source.mm index b3283b5..10ee896 100644 --- a/chrome/browser/ui/cocoa/tab_contents/web_drag_source.mm +++ b/chrome/browser/ui/cocoa/tab_contents/web_drag_source.mm @@ -6,7 +6,6 @@ #include <sys/param.h> -#include "app/mac/nsimage_cache.h" #include "base/file_path.h" #include "base/string_util.h" #include "base/sys_string_conversions.h" @@ -26,6 +25,7 @@ #include "net/base/file_stream.h" #include "net/base/net_util.h" #import "third_party/mozilla/NSPasteboard+Utils.h" +#include "ui/gfx/mac/nsimage_cache.h" #include "webkit/glue/webdropdata.h" using base::SysNSStringToUTF8; @@ -440,7 +440,7 @@ void PromiseWriterTask::Run() { return dragImage_; // Default to returning a generic image. - return app::mac::GetCachedImageWithName(@"nav.pdf"); + return gfx::GetCachedImageWithName(@"nav.pdf"); } @end // @implementation WebDragSource (Private) diff --git a/chrome/browser/ui/cocoa/tabpose_window.mm b/chrome/browser/ui/cocoa/tabpose_window.mm index dabac24..b62a9e7 100644 --- a/chrome/browser/ui/cocoa/tabpose_window.mm +++ b/chrome/browser/ui/cocoa/tabpose_window.mm @@ -8,7 +8,6 @@ #include <algorithm> -#include "app/mac/nsimage_cache.h" #include "base/mac/mac_util.h" #include "base/mac/scoped_cftyperef.h" #include "base/memory/scoped_callback_factory.h" diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm index 95c9cae..22eb4af 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm @@ -9,7 +9,6 @@ #include <limits> #include <string> -#include "app/mac/nsimage_cache.h" #include "base/command_line.h" #include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" @@ -65,6 +64,7 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/image/image.h" +#include "ui/gfx/mac/nsimage_cache.h" NSString* const kTabStripNumberOfTabsChanged = @"kTabStripNumberOfTabsChanged"; @@ -371,7 +371,7 @@ class NotificationBridge : public NotificationObserver { permanentSubviews_.reset([[NSMutableArray alloc] init]); defaultFavicon_.reset( - [app::mac::GetCachedImageWithName(@"nav.pdf") retain]); + [gfx::GetCachedImageWithName(@"nav.pdf") retain]); [self setIndentForControls:[[self class] defaultIndentForControls]]; diff --git a/chrome/browser/ui/cocoa/toolbar/reload_button.mm b/chrome/browser/ui/cocoa/toolbar/reload_button.mm index 406e3bd..10cd47f 100644 --- a/chrome/browser/ui/cocoa/toolbar/reload_button.mm +++ b/chrome/browser/ui/cocoa/toolbar/reload_button.mm @@ -1,17 +1,16 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #import "chrome/browser/ui/cocoa/toolbar/reload_button.h" -#include "ui/base/l10n/l10n_util.h" -#include "app/mac/nsimage_cache.h" #include "chrome/app/chrome_command_ids.h" #import "chrome/browser/ui/cocoa/image_button_cell.h" #import "chrome/browser/ui/cocoa/view_id_util.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "grit/theme_resources_standard.h" +#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util_mac.h" namespace { diff --git a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm index 5423e17..8a68fe7 100644 --- a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm +++ b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm @@ -6,7 +6,6 @@ #include <algorithm> -#include "app/mac/nsimage_cache.h" #include "base/mac/mac_util.h" #include "base/memory/singleton.h" #include "base/string_util.h" diff --git a/app/mac/nsimage_cache.h b/ui/gfx/mac/nsimage_cache.h index ed1de06..83179d2 100644 --- a/app/mac/nsimage_cache.h +++ b/ui/gfx/mac/nsimage_cache.h @@ -1,9 +1,9 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APP_MAC_NSIMAGE_CACHE_H_ -#define APP_MAC_NSIMAGE_CACHE_H_ +#ifndef UI_GFX_MAC_NSIMAGE_CACHE_H_ +#define UI_GFX_MAC_NSIMAGE_CACHE_H_ #pragma once #ifdef __OBJC__ @@ -14,8 +14,7 @@ class NSImage; class NSString; #endif -namespace app { -namespace mac { +namespace gfx { // Returns an autoreleased image from the main app bundle // (mac_util::MainAppBundle()) with the given name, and keeps it in memory so @@ -29,7 +28,6 @@ NSImage* GetCachedImageWithName(NSString* name); // Clears the image cache. void ClearCachedImages(void); -} // namespace mac -} // namespace app +} // namespace gfx -#endif // APP_MAC_NSIMAGE_CACHE_H_ +#endif // UI_GFX_MAC_NSIMAGE_CACHE_H_ diff --git a/app/mac/nsimage_cache.mm b/ui/gfx/mac/nsimage_cache.mm index a399b74..e7bb6e3 100644 --- a/app/mac/nsimage_cache.mm +++ b/ui/gfx/mac/nsimage_cache.mm @@ -1,8 +1,8 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "app/mac/nsimage_cache.h" +#include "ui/gfx/mac/nsimage_cache.h" #import <AppKit/AppKit.h> @@ -18,8 +18,7 @@ #undef try #undef catch -namespace app { -namespace mac { +namespace gfx { static NSMutableDictionary* image_cache = nil; @@ -71,5 +70,4 @@ void ClearCachedImages(void) { [image_cache removeAllObjects]; } -} // namespace mac -} // namespace app +} // namespace gfx diff --git a/app/mac/nsimage_cache_unittest.cc.README b/ui/gfx/mac/nsimage_cache_unittest.cc.README index 558426f..558426f 100644 --- a/app/mac/nsimage_cache_unittest.cc.README +++ b/ui/gfx/mac/nsimage_cache_unittest.cc.README diff --git a/app/mac/scoped_nsdisable_screen_updates.h b/ui/gfx/mac/scoped_ns_disable_screen_updates.h index 14a948c..310672a 100644 --- a/app/mac/scoped_nsdisable_screen_updates.h +++ b/ui/gfx/mac/scoped_ns_disable_screen_updates.h @@ -1,17 +1,16 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APP_MAC_SCOPED_NSDISABLE_SCREEN_UPDATES_H_ -#define APP_MAC_SCOPED_NSDISABLE_SCREEN_UPDATES_H_ +#ifndef UI_GFX_MAC_SCOPED_NS_DISABLE_SCREEN_UPDATES_H_ +#define UI_GFX_MAC_SCOPED_NS_DISABLE_SCREEN_UPDATES_H_ #pragma once #import <Cocoa/Cocoa.h> #include "base/basictypes.h" -namespace app { -namespace mac { +namespace gfx { // A stack-based class to disable Cocoa screen updates. When instantiated, it // disables screen updates and enables them when destroyed. Update disabling @@ -31,7 +30,6 @@ class ScopedNSDisableScreenUpdates { DISALLOW_COPY_AND_ASSIGN(ScopedNSDisableScreenUpdates); }; -} // namespace mac -} // namespace app +} // namespace gfx -#endif // APP_MAC_SCOPED_NSDISABLE_SCREEN_UPDATES_H_ +#endif // UI_GFX_MAC_SCOPED_NS_DISABLE_SCREEN_UPDATES_H_ diff --git a/ui/ui_gfx.gypi b/ui/ui_gfx.gypi index 980a807..c9907c3 100644 --- a/ui/ui_gfx.gypi +++ b/ui/ui_gfx.gypi @@ -81,6 +81,9 @@ 'gfx/image/image_util.h', 'gfx/insets.cc', 'gfx/insets.h', + 'gfx/mac/nsimage_cache.h', + 'gfx/mac/nsimage_cache.mm', + 'gfx/mac/scoped_ns_disable_screen_updates.h', 'gfx/native_theme.cc', 'gfx/native_theme.h', 'gfx/native_widget_types.h', diff --git a/webkit/glue/webcursor_mac.mm b/webkit/glue/webcursor_mac.mm index fad30e4..8c72da2 100644 --- a/webkit/glue/webcursor_mac.mm +++ b/webkit/glue/webcursor_mac.mm @@ -7,12 +7,12 @@ #import <AppKit/AppKit.h> #include <Carbon/Carbon.h> -#include "app/mac/nsimage_cache.h" #include "base/logging.h" #include "base/mac/scoped_cftyperef.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebImage.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h" +#include "ui/gfx/mac/nsimage_cache.h" #if WEBKIT_USING_SKIA #include "skia/ext/skia_utils_mac.h" @@ -29,7 +29,7 @@ namespace { NSCursor* LoadCursor(const char* name, int x, int y) { NSString* file_name = [NSString stringWithUTF8String:name]; DCHECK(file_name); - NSImage* cursor_image = app::mac::GetCachedImageWithName(file_name); + NSImage* cursor_image = gfx::GetCachedImageWithName(file_name); DCHECK(cursor_image); return [[[NSCursor alloc] initWithImage:cursor_image hotSpot:NSMakePoint(x, y)] autorelease]; |