OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 25 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
26 #import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h" | 26 #import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h" |
27 #import "chrome/browser/ui/cocoa/tab_contents/favicon_util_mac.h" | 27 #import "chrome/browser/ui/cocoa/tab_contents/favicon_util_mac.h" |
28 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" | 28 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
29 #import "chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h" | 29 #import "chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h" |
30 #include "chrome/common/pref_names.h" | 30 #include "chrome/common/pref_names.h" |
31 #include "content/public/browser/browser_thread.h" | 31 #include "content/public/browser/browser_thread.h" |
32 #include "content/public/browser/render_view_host.h" | 32 #include "content/public/browser/render_view_host.h" |
33 #include "content/public/browser/render_widget_host_view.h" | 33 #include "content/public/browser/render_widget_host_view.h" |
34 #include "content/public/browser/web_contents.h" | 34 #include "content/public/browser/web_contents.h" |
| 35 #include "content/public/browser/web_contents_view.h" |
35 #include "grit/theme_resources.h" | 36 #include "grit/theme_resources.h" |
36 #include "grit/ui_resources.h" | 37 #include "grit/ui_resources.h" |
37 #include "skia/ext/skia_utils_mac.h" | 38 #include "skia/ext/skia_utils_mac.h" |
38 #include "third_party/skia/include/utils/mac/SkCGUtils.h" | 39 #include "third_party/skia/include/utils/mac/SkCGUtils.h" |
39 #include "ui/base/resource/resource_bundle.h" | 40 #include "ui/base/resource/resource_bundle.h" |
40 #include "ui/gfx/image/image.h" | 41 #include "ui/gfx/image/image.h" |
41 #include "ui/gfx/scoped_cg_context_save_gstate_mac.h" | 42 #include "ui/gfx/scoped_cg_context_save_gstate_mac.h" |
42 | 43 |
43 using content::BrowserThread; | 44 using content::BrowserThread; |
44 using content::RenderWidgetHost; | 45 using content::RenderWidgetHost; |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 bitmap, base::mac::GetSystemColorSpace())); | 207 bitmap, base::mac::GetSystemColorSpace())); |
207 loader_ = NULL; | 208 loader_ = NULL; |
208 [self setNeedsDisplay]; | 209 [self setNeedsDisplay]; |
209 } | 210 } |
210 | 211 |
211 - (int)topOffset { | 212 - (int)topOffset { |
212 int topOffset = 0; | 213 int topOffset = 0; |
213 | 214 |
214 // Medium term, we want to show thumbs of the actual info bar views, which | 215 // Medium term, we want to show thumbs of the actual info bar views, which |
215 // means I need to create InfoBarControllers here. | 216 // means I need to create InfoBarControllers here. |
216 NSWindow* window = [contents_->GetNativeView() window]; | 217 NSWindow* window = [contents_->GetView()->GetNativeView() window]; |
217 NSWindowController* windowController = [window windowController]; | 218 NSWindowController* windowController = [window windowController]; |
218 if ([windowController isKindOfClass:[BrowserWindowController class]]) { | 219 if ([windowController isKindOfClass:[BrowserWindowController class]]) { |
219 BrowserWindowController* bwc = | 220 BrowserWindowController* bwc = |
220 static_cast<BrowserWindowController*>(windowController); | 221 static_cast<BrowserWindowController*>(windowController); |
221 InfoBarContainerController* infoBarContainer = | 222 InfoBarContainerController* infoBarContainer = |
222 [bwc infoBarContainerController]; | 223 [bwc infoBarContainerController]; |
223 // TODO(thakis|rsesek): This is not correct for background tabs with | 224 // TODO(thakis|rsesek): This is not correct for background tabs with |
224 // infobars as the aspect ratio will be wrong. Fix that. | 225 // infobars as the aspect ratio will be wrong. Fix that. |
225 topOffset += NSHeight([[infoBarContainer view] frame]) - | 226 topOffset += NSHeight([[infoBarContainer view] frame]) - |
226 [infoBarContainer overlappingTipHeight]; | 227 [infoBarContainer overlappingTipHeight]; |
(...skipping 1433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1660 tile.set_tab_contents(contents); | 1661 tile.set_tab_contents(contents); |
1661 ThumbnailLayer* thumbLayer = [allThumbnailLayers_ objectAtIndex:index]; | 1662 ThumbnailLayer* thumbLayer = [allThumbnailLayers_ objectAtIndex:index]; |
1662 [thumbLayer setWebContents:contents]; | 1663 [thumbLayer setWebContents:contents]; |
1663 } | 1664 } |
1664 | 1665 |
1665 - (void)tabStripModelDeleted { | 1666 - (void)tabStripModelDeleted { |
1666 [self close]; | 1667 [self close]; |
1667 } | 1668 } |
1668 | 1669 |
1669 @end | 1670 @end |
OLD | NEW |