Changeset 85250 in webkit


Ignore:
Timestamp:
Apr 28, 2011 3:33:54 PM (13 years ago)
Author:
bweinstein@apple.com
Message:

Web Inspector: REGRESSION(85051): Develop Menu items are wrong when inspector is frontmost window
https://bugs.webkit.org/show_bug.cgi?id=59747

Reviewed by Timothy Hatcher.

Restore functions that were removed in r85051. They were needed when the inspector is the frontmost window.
Also update them to call _inspectedWebView.get() - since it's a RetainPtr now.

  • WebCoreSupport/WebInspectorClient.mm:

(-[WebInspectorWindowController showWebInspector:]):
(-[WebInspectorWindowController showErrorConsole:]):
(-[WebInspectorWindowController toggleDebuggingJavaScript:]):
(-[WebInspectorWindowController toggleProfilingJavaScript:]):
(-[WebInspectorWindowController validateUserInterfaceItem:]):

Location:
trunk/Source/WebKit/mac
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/mac/ChangeLog

    r85248 r85250  
     12011-04-28  Brian Weinstein  <bweinstein@apple.com>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        Web Inspector: REGRESSION(85051): Develop Menu items are wrong when inspector is frontmost window
     6        https://bugs.webkit.org/show_bug.cgi?id=59747
     7
     8        Restore functions that were removed in r85051. They were needed when the inspector is the frontmost window.
     9        Also update them to call _inspectedWebView.get() - since it's a RetainPtr now.
     10
     11        * WebCoreSupport/WebInspectorClient.mm:
     12        (-[WebInspectorWindowController showWebInspector:]):
     13        (-[WebInspectorWindowController showErrorConsole:]):
     14        (-[WebInspectorWindowController toggleDebuggingJavaScript:]):
     15        (-[WebInspectorWindowController toggleProfilingJavaScript:]):
     16        (-[WebInspectorWindowController validateUserInterfaceItem:]):
     17
    1182011-04-28  David Kilzer  <ddkilzer@apple.com>
    219
  • trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm

    r85051 r85250  
    473473}
    474474
     475// MARK: -
     476// These methods can be used by UI elements such as menu items and toolbar buttons when the inspector is the key window.
     477
     478// This method is really only implemented to keep any UI elements enabled.
     479- (void)showWebInspector:(id)sender
     480{
     481    [[_inspectedWebView.get() inspector] show:sender];
     482}
     483
     484- (void)showErrorConsole:(id)sender
     485{
     486    [[_inspectedWebView.get() inspector] showConsole:sender];
     487}
     488
     489- (void)toggleDebuggingJavaScript:(id)sender
     490{
     491    [[_inspectedWebView.get() inspector] toggleDebuggingJavaScript:sender];
     492}
     493
     494- (void)toggleProfilingJavaScript:(id)sender
     495{
     496    [[_inspectedWebView.get() inspector] toggleProfilingJavaScript:sender];
     497}
     498
     499- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item
     500{
     501    BOOL isMenuItem = [(id)item isKindOfClass:[NSMenuItem class]];
     502    if ([item action] == @selector(toggleDebuggingJavaScript:) && isMenuItem) {
     503        NSMenuItem *menuItem = (NSMenuItem *)item;
     504        if ([[_inspectedWebView.get() inspector] isDebuggingJavaScript])
     505            [menuItem setTitle:UI_STRING_INTERNAL("Stop Debugging JavaScript", "title for Stop Debugging JavaScript menu item")];
     506        else
     507            [menuItem setTitle:UI_STRING_INTERNAL("Start Debugging JavaScript", "title for Start Debugging JavaScript menu item")];
     508    } else if ([item action] == @selector(toggleProfilingJavaScript:) && isMenuItem) {
     509        NSMenuItem *menuItem = (NSMenuItem *)item;
     510        if ([[_inspectedWebView.get() inspector] isProfilingJavaScript])
     511            [menuItem setTitle:UI_STRING_INTERNAL("Stop Profiling JavaScript", "title for Stop Profiling JavaScript menu item")];
     512        else
     513            [menuItem setTitle:UI_STRING_INTERNAL("Start Profiling JavaScript", "title for Start Profiling JavaScript menu item")];
     514    }
     515
     516    return YES;
     517}
     518
     519
    475520@end
Note: See TracChangeset for help on using the changeset viewer.