Commit cc4b9e12 authored by avi@chromium.org's avatar avi@chromium.org

Add Debug menu to Mac Content Shell.

BUG=141668
TEST=Debug menu, opening inspector works


Review URL: https://chromiumcodereview.appspot.com/10823263

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151029 0039d316-1c4b-4281-b951-d872f2087c98
parent 0a26df0e
......@@ -2,17 +2,17 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1050</int>
<string key="IBDocument.SystemVersion">11B26</string>
<string key="IBDocument.SystemVersion">12A269</string>
<string key="IBDocument.InterfaceBuilderVersion">851</string>
<string key="IBDocument.AppKitVersion">1138</string>
<string key="IBDocument.HIToolboxVersion">566.00</string>
<string key="IBDocument.AppKitVersion">1187</string>
<string key="IBDocument.HIToolboxVersion">624.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">851</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="29"/>
<integer value="441"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
......@@ -676,6 +676,29 @@
</object>
</object>
</object>
<object class="NSMenuItem" id="1072472181">
<reference key="NSMenu" ref="649796088"/>
<string key="NSTitle">Debug</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="293900348"/>
<reference key="NSMixedImage" ref="169361956"/>
<string key="NSAction">submenuAction:</string>
<object class="NSMenu" key="NSSubmenu" id="299203964">
<string key="NSTitle">Debug</string>
<object class="NSMutableArray" key="NSMenuItems">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSMenuItem" id="200102617">
<reference key="NSMenu" ref="299203964"/>
<string key="NSTitle">Show Developer Tools</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="293900348"/>
<reference key="NSMixedImage" ref="169361956"/>
</object>
</object>
</object>
</object>
<object class="NSMenuItem" id="713487014">
<reference key="NSMenu" ref="649796088"/>
<string key="NSTitle">Window</string>
......@@ -1078,6 +1101,14 @@
</object>
<int key="connectionID">374</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">showDevTools:</string>
<reference key="source" ref="1014"/>
<reference key="destination" ref="200102617"/>
</object>
<int key="connectionID">443</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
......@@ -1120,6 +1151,7 @@
<reference ref="379814623"/>
<reference ref="586577488"/>
<reference ref="626404410"/>
<reference ref="1072472181"/>
</object>
<reference key="parent" ref="755588897"/>
<string key="objectName">MainMenu</string>
......@@ -1684,6 +1716,29 @@
<reference key="object" ref="143541711"/>
<reference key="parent" ref="755588897"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">440</int>
<reference key="object" ref="1072472181"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="299203964"/>
</object>
<reference key="parent" ref="649796088"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">441</int>
<reference key="object" ref="299203964"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="200102617"/>
</object>
<reference key="parent" ref="1072472181"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">442</int>
<reference key="object" ref="200102617"/>
<reference key="parent" ref="299203964"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
......@@ -1831,6 +1886,10 @@
<string>354.IBPluginDependency</string>
<string>354.ImportedFromIB2</string>
<string>389.IBPluginDependency</string>
<string>440.IBPluginDependency</string>
<string>441.IBEditorWindowLastContentRect</string>
<string>441.IBPluginDependency</string>
<string>442.IBPluginDependency</string>
<string>5.IBPluginDependency</string>
<string>5.ImportedFromIB2</string>
<string>56.IBPluginDependency</string>
......@@ -1980,7 +2039,7 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>{{304, 905}, {197, 73}}</string>
<string>{{541, 739}, {460, 20}}</string>
<string>{{541, 739}, {523, 20}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>{74, 862}</string>
......@@ -2012,6 +2071,10 @@
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{869, 716}, {202, 23}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
......@@ -2065,9 +2128,31 @@
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">439</int>
<int key="maxID">443</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">FirstResponder</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">showDevTools:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">showDevTools:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">showDevTools:</string>
<string key="candidateClassName">id</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
</object>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
......@@ -2090,8 +2175,8 @@
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>{9, 8}</string>
<string>{7, 2}</string>
<string>{11, 11}</string>
<string>{10, 3}</string>
</object>
</object>
</data>
......
......@@ -79,13 +79,8 @@ void ShellBrowserMainParts::PreMainMessageLoopRun() {
Shell::PlatformInitialize();
net::NetModule::SetResourceProvider(Shell::PlatformResourceProvider);
#if defined(OS_ANDROID)
devtools_delegate_ = new ShellDevToolsDelegate(
browser_context_->GetRequestContext());
#else
devtools_delegate_ = new ShellDevToolsDelegate(
browser_context_->GetRequestContext());
#endif
if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) {
Shell::CreateNewWindow(browser_context_.get(),
......
......@@ -83,6 +83,26 @@ enum {
@end
@interface CrShellWindow : UnderlayOpenGLHostingWindow {
@private
content::Shell* shell_;
}
- (void)setShell:(content::Shell*)shell;
- (void)showDevTools:(id)sender;
@end
@implementation CrShellWindow
- (void)setShell:(content::Shell*)shell {
shell_ = shell;
}
- (void)showDevTools:(id)sender {
shell_->ShowDevTools();
}
@end
namespace {
NSString* kWindowTitle = @"Content Shell";
......@@ -168,11 +188,13 @@ void Shell::PlatformCreateWindow(int width, int height) {
content_rect = NSOffsetRect(initial_window_bounds, -10000, -10000);
style_mask = NSBorderlessWindowMask;
}
window_ = [[UnderlayOpenGLHostingWindow alloc]
initWithContentRect:content_rect
styleMask:style_mask
backing:NSBackingStoreBuffered
defer:NO];
CrShellWindow* window =
[[CrShellWindow alloc] initWithContentRect:content_rect
styleMask:style_mask
backing:NSBackingStoreBuffered
defer:NO];
window_ = window;
[window setShell:this];
[window_ setTitle:kWindowTitle];
NSView* content = [window_ contentView];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment