| Index: components/app_modal_dialogs/javascript_dialog_manager_client.h
 | 
| diff --git a/components/app_modal_dialogs/javascript_dialog_manager_client.h b/components/app_modal_dialogs/javascript_dialog_manager_client.h
 | 
| new file mode 100644
 | 
| index 0000000000000000000000000000000000000000..6b7724d647b0dc3e72a776ae824c8b5340eefd5a
 | 
| --- /dev/null
 | 
| +++ b/components/app_modal_dialogs/javascript_dialog_manager_client.h
 | 
| @@ -0,0 +1,56 @@
 | 
| +// Copyright 2014 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.
 | 
| +
 | 
| +#ifndef COMPONENTS_APP_MODAL_DIALOGS_JAVASCRIPT_DIALOG_MANAGER_CLIENT_H_
 | 
| +#define COMPONENTS_APP_MODAL_DIALOGS_JAVASCRIPT_DIALOG_MANAGER_CLIENT_H_
 | 
| +
 | 
| +#include <string>
 | 
| +
 | 
| +#include "base/memory/scoped_ptr.h"
 | 
| +#include "ui/gfx/native_widget_types.h"
 | 
| +
 | 
| +class GURL;
 | 
| +class NativeAppModalDialog;
 | 
| +class JavaScriptAppModalDialog;
 | 
| +
 | 
| +namespace content {
 | 
| +class WebContents;
 | 
| +}
 | 
| +
 | 
| +class JavaScriptDialogManagerClient {
 | 
| + public:
 | 
| +  virtual ~JavaScriptDialogManagerClient() {}
 | 
| +
 | 
| +  // Creates an app modal dialog for a JavaScript prompt;
 | 
| +  virtual NativeAppModalDialog* CreateNativeJavaScriptPrompt(
 | 
| +      JavaScriptAppModalDialog* dialog,
 | 
| +      gfx::NativeWindow parent_window) = 0;
 | 
| +
 | 
| +  // Called when the extension associated with |web_contents| opened
 | 
| +  // a dialog. The embedder should increment its keep alive count so
 | 
| +  // that its lazy background page can stay alive.
 | 
| +  virtual void IncrementLazyKeepaliveCount(
 | 
| +      content::WebContents* web_contents) = 0;
 | 
| +
 | 
| +  // Called when a dialog created by the extension associated with
 | 
| +  // |web_contents| is closed. The embedder should decrement
 | 
| +  // its keep alive count so that the extension can shutdown
 | 
| +  // its lazy background page.
 | 
| +  virtual void DecrementLazyKeepaliveCount(
 | 
| +      content::WebContents* web_contents) = 0;
 | 
| +
 | 
| +  // Sets the name of the extensions associated with the |web_contents|
 | 
| +  // in the |name_out|, and returns true. If there is no extension associated
 | 
| +  // with the |web_contents|, returns false.
 | 
| +  virtual bool GetExtensionName(content::WebContents* web_contents,
 | 
| +                                const GURL& origin_url,
 | 
| +                                std::string* name_out) = 0;
 | 
| +};
 | 
| +
 | 
| +void SetJavaScriptDialogManagerClient(
 | 
| +    scoped_ptr<JavaScriptDialogManagerClient> client);
 | 
| +
 | 
| +JavaScriptDialogManagerClient* GetJavaScriptDialogManagerClient();
 | 
| +
 | 
| +#endif  // COMPONENTS_APP_MODAL_DIALOGS_JAVASCRIPT_DIALOG_MANAGER_CLIENT_H_
 | 
| 
 |