Logo Search packages:      
Sourcecode: chromium-browser version File versions  Download package


// 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.


#include "base/scoped_ptr.h"
#include "base/scoped_nsobject.h"

#import <Cocoa/Cocoa.h>

class AsyncUninstaller;
class DevmodeObserver;
class Extension;
class ExtensionAction;
class NotificationRegistrar;
class Profile;

namespace extension_action_context_menu {

class DevmodeObserver;


// A context menu used by the Browser and Page Action components that appears
// if a user right-clicks the view of the given extension.
@interface ExtensionActionContextMenu : NSMenu {
  // The extension that this menu belongs to. Weak.
  Extension* extension_;

  // The extension action this menu belongs to. Weak.
  ExtensionAction* action_;

  // The browser profile of the window that contains this extension. Weak.
  Profile* profile_;

  // The inspector menu item.  Need to keep this around to add and remove it.
  scoped_nsobject<NSMenuItem> inspectorItem_;

  // The observer used to listen for pref changed notifications.
  scoped_ptr<extension_action_context_menu::DevmodeObserver> observer_;

  // Used to load the extension icon asynchronously on the I/O thread then show
  // the uninstall confirmation dialog.
  scoped_ptr<AsyncUninstaller> uninstaller_;

// Initializes and returns a context menu for the given extension and profile.
- (id)initWithExtension:(Extension*)extension

// Show or hide the inspector menu item.
- (void)updateInspectorItem;


typedef ExtensionActionContextMenu ExtensionActionContextMenuMac;


Generated by  Doxygen 1.6.0   Back to index