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

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

Issue 9015022: Replace most of Browser::GetSelectedTabContents calls into Browser::GetSelectedWebContents. I've ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/browser_window_controller_private.h" 5 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #import "base/memory/scoped_nsobject.h" 10 #import "base/memory/scoped_nsobject.h"
(...skipping 18 matching lines...) Expand all
29 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" 29 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h"
30 #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" 30 #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h"
31 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" 31 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h"
32 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 32 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
33 #include "chrome/common/pref_names.h" 33 #include "chrome/common/pref_names.h"
34 #include "content/browser/renderer_host/render_widget_host_view.h" 34 #include "content/browser/renderer_host/render_widget_host_view.h"
35 #include "content/browser/tab_contents/tab_contents.h" 35 #include "content/browser/tab_contents/tab_contents.h"
36 #include "content/browser/tab_contents/tab_contents_view.h" 36 #include "content/browser/tab_contents/tab_contents_view.h"
37 #include "ui/base/ui_base_types.h" 37 #include "ui/base/ui_base_types.h"
38 38
39 using content::WebContents;
40
39 // Forward-declare symbols that are part of the 10.6 SDK. 41 // Forward-declare symbols that are part of the 10.6 SDK.
40 #if !defined(MAC_OS_X_VERSION_10_6) || \ 42 #if !defined(MAC_OS_X_VERSION_10_6) || \
41 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6 43 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
42 44
43 enum { 45 enum {
44 NSApplicationPresentationDefault = 0, 46 NSApplicationPresentationDefault = 0,
45 NSApplicationPresentationAutoHideDock = (1 << 0), 47 NSApplicationPresentationAutoHideDock = (1 << 0),
46 NSApplicationPresentationHideDock = (1 << 1), 48 NSApplicationPresentationHideDock = (1 << 1),
47 NSApplicationPresentationAutoHideMenuBar = (1 << 2), 49 NSApplicationPresentationAutoHideMenuBar = (1 << 2),
48 NSApplicationPresentationHideMenuBar = (1 << 3), 50 NSApplicationPresentationHideMenuBar = (1 << 3),
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 513
512 bool contentShifted = 514 bool contentShifted =
513 NSMaxY(tabContentFrame) != NSMaxY(newFrame) || 515 NSMaxY(tabContentFrame) != NSMaxY(newFrame) ||
514 NSMinX(tabContentFrame) != NSMinX(newFrame); 516 NSMinX(tabContentFrame) != NSMinX(newFrame);
515 517
516 tabContentFrame = newFrame; 518 tabContentFrame = newFrame;
517 [tabContentView setFrame:tabContentFrame]; 519 [tabContentView setFrame:tabContentFrame];
518 520
519 // If the relayout shifts the content area up or down, let the renderer know. 521 // If the relayout shifts the content area up or down, let the renderer know.
520 if (contentShifted) { 522 if (contentShifted) {
521 if (TabContents* contents = browser_->GetSelectedTabContents()) { 523 if (WebContents* contents = browser_->GetSelectedWebContents()) {
522 if (RenderWidgetHostView* rwhv = contents->GetRenderWidgetHostView()) 524 if (RenderWidgetHostView* rwhv = contents->GetRenderWidgetHostView())
523 rwhv->WindowFrameChanged(); 525 rwhv->WindowFrameChanged();
524 } 526 }
525 } 527 }
526 } 528 }
527 529
528 - (BOOL)shouldShowBookmarkBar { 530 - (BOOL)shouldShowBookmarkBar {
529 DCHECK(browser_.get()); 531 DCHECK(browser_.get());
530 return browser_->profile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar) ? 532 return browser_->profile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar) ?
531 YES : NO; 533 YES : NO;
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 - (void)disableBarVisibilityUpdates { 899 - (void)disableBarVisibilityUpdates {
898 // Early escape if there's nothing to do. 900 // Early escape if there's nothing to do.
899 if (!barVisibilityUpdatesEnabled_) 901 if (!barVisibilityUpdatesEnabled_)
900 return; 902 return;
901 903
902 barVisibilityUpdatesEnabled_ = NO; 904 barVisibilityUpdatesEnabled_ = NO;
903 [presentationModeController_ cancelAnimationAndTimers]; 905 [presentationModeController_ cancelAnimationAndTimers];
904 } 906 }
905 907
906 @end // @implementation BrowserWindowController(Private) 908 @end // @implementation BrowserWindowController(Private)
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.mm ('k') | chrome/browser/ui/cocoa/dev_tools_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698