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

Side by Side Diff: chrome/browser/ui/cocoa/tabpose_window.mm

Issue 10945010: Switch BookmarkTabHelper to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 BrowserWindowController* bwc = 230 BrowserWindowController* bwc =
231 static_cast<BrowserWindowController*>(windowController); 231 static_cast<BrowserWindowController*>(windowController);
232 InfoBarContainerController* infoBarContainer = 232 InfoBarContainerController* infoBarContainer =
233 [bwc infoBarContainerController]; 233 [bwc infoBarContainerController];
234 // TODO(thakis|rsesek): This is not correct for background tabs with 234 // TODO(thakis|rsesek): This is not correct for background tabs with
235 // infobars as the aspect ratio will be wrong. Fix that. 235 // infobars as the aspect ratio will be wrong. Fix that.
236 topOffset += NSHeight([[infoBarContainer view] frame]) - 236 topOffset += NSHeight([[infoBarContainer view] frame]) -
237 [infoBarContainer overlappingTipHeight]; 237 [infoBarContainer overlappingTipHeight];
238 } 238 }
239 239
240 BookmarkTabHelper* bookmark_tab_helper =
241 BookmarkTabHelper::FromWebContents(contents_->web_contents());
240 bool always_show_bookmark_bar = 242 bool always_show_bookmark_bar =
241 contents_->profile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar); 243 contents_->profile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar);
242 bool has_detached_bookmark_bar = 244 bool has_detached_bookmark_bar =
243 contents_->bookmark_tab_helper()->ShouldShowBookmarkBar() && 245 bookmark_tab_helper->ShouldShowBookmarkBar() &&
244 !always_show_bookmark_bar; 246 !always_show_bookmark_bar;
245 if (has_detached_bookmark_bar) 247 if (has_detached_bookmark_bar)
246 topOffset += bookmarks::kNTPBookmarkBarHeight; 248 topOffset += bookmarks::kNTPBookmarkBarHeight;
247 249
248 return topOffset; 250 return topOffset;
249 } 251 }
250 252
251 - (int)bottomOffset { 253 - (int)bottomOffset {
252 int bottomOffset = 0; 254 int bottomOffset = 0;
253 TabContents* devToolsContents = 255 TabContents* devToolsContents =
(...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after
1667 tile.set_tab_contents(contents); 1669 tile.set_tab_contents(contents);
1668 ThumbnailLayer* thumbLayer = [allThumbnailLayers_ objectAtIndex:index]; 1670 ThumbnailLayer* thumbLayer = [allThumbnailLayers_ objectAtIndex:index];
1669 [thumbLayer setTabContents:contents]; 1671 [thumbLayer setTabContents:contents];
1670 } 1672 }
1671 1673
1672 - (void)tabStripModelDeleted { 1674 - (void)tabStripModelDeleted {
1673 [self close]; 1675 [self close];
1674 } 1676 }
1675 1677
1676 @end 1678 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller_private.mm ('k') | chrome/browser/ui/tab_contents/tab_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698