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

Unified Diff: chrome/browser/cocoa/tab_contents_controller.mm

Issue 2973004: [Mac]Implement ViewID support. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Turns out that, it's not a good solution. Created 10 years, 5 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/cocoa/side_tab_strip_view.mm ('k') | chrome/browser/cocoa/tab_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/tab_contents_controller.mm
diff --git a/chrome/browser/cocoa/tab_contents_controller.mm b/chrome/browser/cocoa/tab_contents_controller.mm
index 131d38c8f90cd33eb791af44adda6896b272ebd8..d38598f07d6197add1de4a190134501e19302c2a 100644
--- a/chrome/browser/cocoa/tab_contents_controller.mm
+++ b/chrome/browser/cocoa/tab_contents_controller.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -8,6 +8,7 @@
#include "base/sys_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
+#import "chrome/browser/cocoa/base_view.h"
#include "chrome/browser/pref_service.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/tab_contents/tab_contents.h"
@@ -92,14 +93,18 @@ static const int kMinWebHeight = 50;
splitOffset = kDefaultContentsSplitOffset;
}
+ BaseView* devtoolsView =
+ static_cast<BaseView*>(devToolsContents->GetNativeView());
+ DCHECK([devtoolsView isKindOfClass:[BaseView class]]);
+ [devtoolsView setViewID:VIEW_ID_DEV_TOOLS_DOCKED];
if ([subviews count] == 1) {
- [contentsContainer_ addSubview:devToolsContents->GetNativeView()];
+ [contentsContainer_ addSubview:devtoolsView];
} else {
DCHECK_EQ([subviews count], 2u);
[contentsContainer_ replaceSubview:[subviews objectAtIndex:1]
- with:devToolsContents->GetNativeView()];
+ with:devtoolsView];
// If devtools are already visible, keep the current size.
- splitOffset = NSHeight([devToolsContents->GetNativeView() frame]);
+ splitOffset = NSHeight([devtoolsView frame]);
}
// Make sure |splitOffset| isn't too large or too small.
@@ -111,9 +116,9 @@ static const int kMinWebHeight = 50;
// It seems as if |-setPosition:ofDividerAtIndex:| should do what's needed,
// but I can't figure out how to use it. Manually resize web and devtools.
- NSRect devtoolsFrame = [devToolsContents->GetNativeView() frame];
+ NSRect devtoolsFrame = [devtoolsView frame];
devtoolsFrame.size.height = splitOffset;
- [devToolsContents->GetNativeView() setFrame:devtoolsFrame];
+ [devtoolsView setFrame:devtoolsFrame];
NSRect webFrame = [[subviews objectAtIndex:0] frame];
webFrame.size.height = NSHeight([contentsContainer_ frame]) -
« no previous file with comments | « chrome/browser/cocoa/side_tab_strip_view.mm ('k') | chrome/browser/cocoa/tab_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698