OLD | NEW |
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 #import "chrome/browser/ui/cocoa/tabpose_window.h" | 5 #import "chrome/browser/ui/cocoa/tabpose_window.h" |
6 | 6 |
7 #import <QuartzCore/QuartzCore.h> | 7 #import <QuartzCore/QuartzCore.h> |
8 | 8 |
9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
10 #include "base/mac_util.h" | 10 #include "base/mac/mac_util.h" |
11 #include "base/mac/scoped_cftyperef.h" | 11 #include "base/mac/scoped_cftyperef.h" |
12 #include "base/scoped_callback_factory.h" | 12 #include "base/scoped_callback_factory.h" |
13 #include "base/sys_string_conversions.h" | 13 #include "base/sys_string_conversions.h" |
14 #include "chrome/app/chrome_command_ids.h" | 14 #include "chrome/app/chrome_command_ids.h" |
15 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
16 #import "chrome/browser/debugger/devtools_window.h" | 16 #import "chrome/browser/debugger/devtools_window.h" |
17 #include "chrome/browser/prefs/pref_service.h" | 17 #include "chrome/browser/prefs/pref_service.h" |
18 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
19 #include "chrome/browser/renderer_host/backing_store_mac.h" | 19 #include "chrome/browser/renderer_host/backing_store_mac.h" |
20 #include "chrome/browser/renderer_host/render_view_host.h" | 20 #include "chrome/browser/renderer_host/render_view_host.h" |
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 NSImage* nsFavicon = gfx::SkBitmapToNSImage(tile.favicon()); | 1013 NSImage* nsFavicon = gfx::SkBitmapToNSImage(tile.favicon()); |
1014 // Either we don't have a valid favicon or there was some issue converting | 1014 // Either we don't have a valid favicon or there was some issue converting |
1015 // it from an SkBitmap. Either way, just show the default. | 1015 // it from an SkBitmap. Either way, just show the default. |
1016 if (!nsFavicon) { | 1016 if (!nsFavicon) { |
1017 NSImage* defaultFavIcon = | 1017 NSImage* defaultFavIcon = |
1018 ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 1018 ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
1019 IDR_DEFAULT_FAVICON); | 1019 IDR_DEFAULT_FAVICON); |
1020 nsFavicon = defaultFavIcon; | 1020 nsFavicon = defaultFavIcon; |
1021 } | 1021 } |
1022 base::mac::ScopedCFTypeRef<CGImageRef> favicon( | 1022 base::mac::ScopedCFTypeRef<CGImageRef> favicon( |
1023 mac_util::CopyNSImageToCGImage(nsFavicon)); | 1023 base::mac::CopyNSImageToCGImage(nsFavicon)); |
1024 | 1024 |
1025 CALayer* faviconLayer = [CALayer layer]; | 1025 CALayer* faviconLayer = [CALayer layer]; |
1026 if (showZoom) { | 1026 if (showZoom) { |
1027 AnimateCALayerFrameFromTo( | 1027 AnimateCALayerFrameFromTo( |
1028 faviconLayer, | 1028 faviconLayer, |
1029 tile.GetFaviconStartRectRelativeTo(tileSet_->selected_tile()), | 1029 tile.GetFaviconStartRectRelativeTo(tileSet_->selected_tile()), |
1030 tile.favicon_rect(), | 1030 tile.favicon_rect(), |
1031 interval, | 1031 interval, |
1032 nil); | 1032 nil); |
1033 AnimateCALayerOpacityFromTo(faviconLayer, 0.0, 1.0, interval); | 1033 AnimateCALayerOpacityFromTo(faviconLayer, 0.0, 1.0, interval); |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1545 tile.set_tab_contents(contents->tab_contents()); | 1545 tile.set_tab_contents(contents->tab_contents()); |
1546 ThumbnailLayer* thumbLayer = [allThumbnailLayers_ objectAtIndex:index]; | 1546 ThumbnailLayer* thumbLayer = [allThumbnailLayers_ objectAtIndex:index]; |
1547 [thumbLayer setTabContents:contents->tab_contents()]; | 1547 [thumbLayer setTabContents:contents->tab_contents()]; |
1548 } | 1548 } |
1549 | 1549 |
1550 - (void)tabStripModelDeleted { | 1550 - (void)tabStripModelDeleted { |
1551 [self close]; | 1551 [self close]; |
1552 } | 1552 } |
1553 | 1553 |
1554 @end | 1554 @end |
OLD | NEW |