summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/html_dialog_view.h
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-03 23:54:45 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-03 23:54:45 +0000
commitfeacf6810018543467b9befdfdc0d52dc9ae7d92 (patch)
tree3c79970c0e7226d482ac8132aade6022c1cfbc0b /chrome/browser/views/html_dialog_view.h
parent2ba5cda1fd02703c0066d297bcfb5848d6d926b9 (diff)
downloadchromium_src-feacf6810018543467b9befdfdc0d52dc9ae7d92.zip
chromium_src-feacf6810018543467b9befdfdc0d52dc9ae7d92.tar.gz
chromium_src-feacf6810018543467b9befdfdc0d52dc9ae7d92.tar.bz2
Created HtmlDialogTabContentsDelegate, which encapsulates the TabContentsDelegate behavior for HTML dialogs. Made all three implementations (gtk, win32, and cocoa) use it.
This also makes HTML dialogs not tied to a Browser instance. Also, unlike the current behavior, any links followed from an HTML dialog box will be opened in a non-incognito browser, even if the HTML dialog was launched from an incognito browser. According to beng, this is okay. BUG=28609 TEST=unittests, manual testing on linux/windows/os x with sync setup wizard Review URL: http://codereview.chromium.org/441011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33752 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/html_dialog_view.h')
-rw-r--r--chrome/browser/views/html_dialog_view.h36
1 files changed, 7 insertions, 29 deletions
diff --git a/chrome/browser/views/html_dialog_view.h b/chrome/browser/views/html_dialog_view.h
index ee9e250..e61c50e 100644
--- a/chrome/browser/views/html_dialog_view.h
+++ b/chrome/browser/views/html_dialog_view.h
@@ -9,7 +9,7 @@
#include "base/gfx/size.h"
#include "chrome/browser/dom_ui/html_dialog_ui.h"
-#include "chrome/browser/tab_contents/tab_contents_delegate.h"
+#include "chrome/browser/dom_ui/html_dialog_tab_contents_delegate.h"
#include "chrome/browser/views/dom_view.h"
#include "views/window/window_delegate.h"
@@ -27,13 +27,17 @@ class Window;
// expected to send back a JSON file as a return value.
//
////////////////////////////////////////////////////////////////////////////////
+//
+// TODO(akalin): Make HtmlDialogView contain an HtmlDialogTabContentsDelegate
+// instead of inheriting from it to avoid violating the "no multiple
+// inheritance" rule.
class HtmlDialogView
: public DOMView,
- public TabContentsDelegate,
+ public HtmlDialogTabContentsDelegate,
public HtmlDialogUIDelegate,
public views::WindowDelegate {
public:
- HtmlDialogView(Browser* parent_browser, HtmlDialogUIDelegate* delegate);
+ HtmlDialogView(Profile* profile, HtmlDialogUIDelegate* delegate);
virtual ~HtmlDialogView();
// Initializes the contents of the dialog (the DOMView and the callbacks).
@@ -62,36 +66,10 @@ class HtmlDialogView
virtual void OnDialogClosed(const std::string& json_retval);
// Overridden from TabContentsDelegate:
- virtual void OpenURLFromTab(TabContents* source,
- const GURL& url,
- const GURL& referrer,
- WindowOpenDisposition disposition,
- PageTransition::Type transition);
- virtual void NavigationStateChanged(const TabContents* source,
- unsigned changed_flags);
- virtual void ReplaceContents(TabContents* source,
- TabContents* new_contents);
- virtual void AddNewContents(TabContents* source,
- TabContents* new_contents,
- WindowOpenDisposition disposition,
- const gfx::Rect& initial_pos,
- bool user_gesture);
- virtual void ActivateContents(TabContents* contents);
- virtual void LoadingStateChanged(TabContents* source);
- virtual void CloseContents(TabContents* source);
virtual void MoveContents(TabContents* source, const gfx::Rect& pos);
- virtual bool IsPopup(TabContents* source);
virtual void ToolbarSizeChanged(TabContents* source, bool is_animating);
- virtual void URLStarredChanged(TabContents* source, bool starred);
- virtual void UpdateTargetURL(TabContents* source, const GURL& url);
private:
- // The Browser object which created this html dialog; we send all
- // window opening/navigations to this object.
- Browser* parent_browser_;
-
- Profile* profile_;
-
// This view is a delegate to the HTML content since it needs to get notified
// about when the dialog is closing. For all other actions (besides dialog
// closing) we delegate to the creator of this view, which we keep track of