1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_SHOW_PARAMS_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_SHOW_PARAMS_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "ui/gfx/native_widget_types.h"
11 class NativeWindowTracker
;
18 // Parameters to show an install prompt dialog. The parameters control:
19 // - The dialog's parent window
20 // - The browser window to use to open a new tab if a user clicks a link in the
22 class ExtensionInstallPromptShowParams
{
24 explicit ExtensionInstallPromptShowParams(content::WebContents
* web_contents
);
26 // The most recently active browser window (or a new browser window if there
27 // are no browser windows) is used if a new tab needs to be opened.
28 ExtensionInstallPromptShowParams(Profile
* profile
, gfx::NativeWindow window
);
30 virtual ~ExtensionInstallPromptShowParams();
36 // The parent web contents for the dialog. Returns NULL if the web contents
37 // have been destroyed.
38 content::WebContents
* GetParentWebContents();
40 // The parent window for the dialog. Returns NULL if the window has been
42 gfx::NativeWindow
GetParentWindow();
44 // Returns true if either the parent web contents or the parent window were
46 bool WasParentDestroyed();
49 void WebContentsDestroyed();
52 content::WebContents
* parent_web_contents_
;
53 bool parent_web_contents_destroyed_
;
54 gfx::NativeWindow parent_window_
;
56 class WebContentsDestructionObserver
;
57 scoped_ptr
<WebContentsDestructionObserver
> web_contents_destruction_observer_
;
59 scoped_ptr
<NativeWindowTracker
> native_window_tracker_
;
61 DISALLOW_COPY_AND_ASSIGN(ExtensionInstallPromptShowParams
);
64 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_SHOW_PARAMS_H_