Index: chrome/browser/ui/cocoa/dev_tools_controller.mm |
=================================================================== |
--- chrome/browser/ui/cocoa/dev_tools_controller.mm (revision 73335) |
+++ chrome/browser/ui/cocoa/dev_tools_controller.mm (working copy) |
@@ -11,6 +11,7 @@ |
#include "chrome/browser/browser_process.h" |
#include "chrome/browser/debugger/devtools_window.h" |
#include "chrome/browser/prefs/pref_service.h" |
+#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/tab_contents/tab_contents.h" |
#import "chrome/browser/ui/cocoa/view_id_util.h" |
#include "chrome/common/pref_names.h" |
@@ -28,7 +29,8 @@ |
@interface DevToolsController (Private) |
-- (void)showDevToolsContents:(TabContents*)devToolsContents; |
+- (void)showDevToolsContents:(TabContents*)devToolsContents |
+ withProfile:(Profile*)profile; |
- (void)resizeDevToolsToNewHeight:(CGFloat)height; |
@end |
@@ -63,19 +65,21 @@ |
return splitView_.get(); |
} |
-- (void)updateDevToolsForTabContents:(TabContents*)contents { |
+- (void)updateDevToolsForTabContents:(TabContents*)contents |
+ withProfile:(Profile*)profile { |
// Get current devtools content. |
TabContents* devToolsContents = contents ? |
DevToolsWindow::GetDevToolsContents(contents) : NULL; |
- [self showDevToolsContents:devToolsContents]; |
+ [self showDevToolsContents:devToolsContents withProfile:profile]; |
} |
- (void)ensureContentsVisible { |
[contentsController_ ensureContentsVisible]; |
} |
-- (void)showDevToolsContents:(TabContents*)devToolsContents { |
+- (void)showDevToolsContents:(TabContents*)devToolsContents |
+ withProfile:(Profile*)profile { |
[contentsController_ ensureContentsSizeDoesNotChange]; |
NSArray* subviews = [splitView_ subviews]; |
@@ -91,8 +95,8 @@ |
CGFloat splitOffset = 0; |
if ([subviews count] == 1) { |
// Load the default split offset. |
- splitOffset = g_browser_process->local_state()->GetInteger( |
- prefs::kDevToolsSplitLocation); |
+ splitOffset = profile->GetPrefs()-> |
+ GetInteger(prefs::kDevToolsSplitLocation); |
if (splitOffset < 0) { |
// Initial load, set to default value. |
splitOffset = kDefaultContentsSplitOffset; |
@@ -117,7 +121,8 @@ |
NSView* oldDevToolsContentsView = [subviews objectAtIndex:1]; |
// Store split offset when hiding devtools window only. |
int splitOffset = NSHeight([oldDevToolsContentsView frame]); |
- g_browser_process->local_state()->SetInteger( |
+ |
+ profile->GetPrefs()->SetInteger( |
prefs::kDevToolsSplitLocation, splitOffset); |
[oldDevToolsContentsView removeFromSuperview]; |
[splitView_ adjustSubviews]; |