Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7858)

Unified Diff: chrome/browser/ui/cocoa/tabpose_window.mm

Issue 6543012: [Mac] Fix cut-off Browser chrome when opening Tabpose with an infobar showing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/tabpose_window.mm
diff --git a/chrome/browser/ui/cocoa/tabpose_window.mm b/chrome/browser/ui/cocoa/tabpose_window.mm
index 22aa6ade9058aae67f26ad9a41d8bd4fe0f0f677..65556aaa0a37c458efbb4cfd09cb2b07d9e8e529 100644
--- a/chrome/browser/ui/cocoa/tabpose_window.mm
+++ b/chrome/browser/ui/cocoa/tabpose_window.mm
@@ -24,6 +24,7 @@
#include "chrome/browser/tab_contents/thumbnail_generator.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h"
#import "chrome/browser/ui/cocoa/browser_window_controller.h"
+#import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h"
#import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h"
#import "chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
@@ -186,10 +187,17 @@ void ThumbnailLoader::LoadThumbnail() {
int topOffset = 0;
// Medium term, we want to show thumbs of the actual info bar views, which
- // means I need to create InfoBarControllers here. At that point, we can get
- // the height from that controller. Until then, hardcode. :-/
- const int kInfoBarHeight = 31;
- topOffset += contents_->infobar_count() * kInfoBarHeight;
+ // means I need to create InfoBarControllers here.
+ NSWindow* window = [contents_->GetNativeView() window];
+ NSWindowController* windowController = [window windowController];
+ DCHECK(windowController);
Nico 2011/03/04 07:34:20 I forgot that all background contents don't have a
+ if ([windowController isKindOfClass:[BrowserWindowController class]]) {
+ BrowserWindowController* bwc =
+ static_cast<BrowserWindowController*>(windowController);
+ InfoBarContainerController* infoBarContainer =
+ [bwc infoBarContainerController];
+ topOffset += NSHeight([[infoBarContainer view] frame]);
+ }
bool always_show_bookmark_bar =
contents_->profile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar);
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698