Add ICU message format support
[chromium-blink-merge.git] / chrome / browser / extensions / extension_install_prompt_show_params.h
blob2fe6aa51c5b3b2ab6f56563155073a9518b563ba
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;
12 class Profile;
14 namespace content {
15 class WebContents;
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
21 // dialog.
22 class ExtensionInstallPromptShowParams {
23 public:
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();
32 Profile* profile() {
33 return profile_;
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
41 // destroyed.
42 gfx::NativeWindow GetParentWindow();
44 // Returns true if either the parent web contents or the parent window were
45 // destroyed.
46 bool WasParentDestroyed();
48 private:
49 void WebContentsDestroyed();
51 Profile* profile_;
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_