diff options
author | stoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-22 19:07:58 +0000 |
---|---|---|
committer | stoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-22 19:07:58 +0000 |
commit | d1cb9f53adcefd8f7ff6abc58ae7edd6f522a42d (patch) | |
tree | da83bb3786b3368ed3df2ad0290bbc04737f202d | |
parent | 9a78bc79debb0f983be2f2c44b6162449238eea3 (diff) | |
download | chromium_src-d1cb9f53adcefd8f7ff6abc58ae7edd6f522a42d.zip chromium_src-d1cb9f53adcefd8f7ff6abc58ae7edd6f522a42d.tar.gz chromium_src-d1cb9f53adcefd8f7ff6abc58ae7edd6f522a42d.tar.bz2 |
Remove unused implementation of TabContentsDelegate in HtmlDialogView.
Review URL: http://codereview.chromium.org/87031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14227 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/views/frame/browser_view.cc | 3 | ||||
-rw-r--r-- | chrome/browser/views/html_dialog_view.cc | 77 | ||||
-rw-r--r-- | chrome/browser/views/html_dialog_view.h | 31 |
3 files changed, 3 insertions, 108 deletions
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index 8652d7f..e9378ff 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -839,8 +839,7 @@ void BrowserView::ShowHTMLDialog(HtmlDialogUIDelegate* delegate, void* parent_window) { HWND parent_hwnd = reinterpret_cast<HWND>(parent_window); parent_hwnd = parent_hwnd ? parent_hwnd : GetWidget()->GetNativeView(); - HtmlDialogView* html_view = new HtmlDialogView(browser_.get(), - browser_->profile(), + HtmlDialogView* html_view = new HtmlDialogView(browser_->profile(), delegate); views::Window::CreateChromeWindow(parent_hwnd, gfx::Rect(), html_view); html_view->InitDialog(); diff --git a/chrome/browser/views/html_dialog_view.cc b/chrome/browser/views/html_dialog_view.cc index 2cdbfda2..1ce1a1f 100644 --- a/chrome/browser/views/html_dialog_view.cc +++ b/chrome/browser/views/html_dialog_view.cc @@ -12,14 +12,11 @@ //////////////////////////////////////////////////////////////////////////////// // HtmlDialogView, public: -HtmlDialogView::HtmlDialogView(Browser* parent_browser, - Profile* profile, +HtmlDialogView::HtmlDialogView(Profile* profile, HtmlDialogUIDelegate* delegate) : DOMView(), - parent_browser_(parent_browser), profile_(profile), delegate_(delegate) { - DCHECK(parent_browser); DCHECK(profile); } @@ -96,78 +93,6 @@ void HtmlDialogView::OnDialogClosed(const std::string& json_retval) { } //////////////////////////////////////////////////////////////////////////////// -// PageNavigator implementation: -void HtmlDialogView::OpenURLFromTab(TabContents* source, - const GURL& url, - const GURL& referrer, - WindowOpenDisposition disposition, - PageTransition::Type transition) { - // Force all links to open in a new window, ignoring the incoming - // disposition. This is a tabless, modal dialog so we can't just - // open it in the current frame. - parent_browser_->OpenURLFromTab(source, url, referrer, NEW_WINDOW, - transition); -} - -//////////////////////////////////////////////////////////////////////////////// -// TabContentsDelegate implementation: - -void HtmlDialogView::NavigationStateChanged(const TabContents* source, - unsigned changed_flags) { - // We shouldn't receive any NavigationStateChanged except the first - // one, which we ignore because we're a dialog box. -} - -void HtmlDialogView::AddNewContents(TabContents* source, - TabContents* new_contents, - WindowOpenDisposition disposition, - const gfx::Rect& initial_pos, - bool user_gesture) { - parent_browser_->AddNewContents( - source, new_contents, NEW_WINDOW, initial_pos, user_gesture); -} - -void HtmlDialogView::ActivateContents(TabContents* contents) { - // We don't do anything here because there's only one TabContents in - // this frame and we don't have a TabStripModel. -} - -void HtmlDialogView::LoadingStateChanged(TabContents* source) { - // We don't care about this notification -} - -void HtmlDialogView::CloseContents(TabContents* source) { - // We receive this message but don't handle it because we really do the - // cleanup in OnDialogClosed(). -} - -void HtmlDialogView::MoveContents(TabContents* source, const gfx::Rect& pos) { - // The contained web page wishes to resize itself. We let it do this because - // if it's a dialog we know about, we trust it not to be mean to the user. - window()->SetBounds(pos); -} - -bool HtmlDialogView::IsPopup(TabContents* source) { - // This needs to return true so that we are allowed to be resized by our - // contents. - return true; -} - -void HtmlDialogView::ToolbarSizeChanged(TabContents* source, - bool is_animating) { - Layout(); -} - -void HtmlDialogView::URLStarredChanged(TabContents* source, bool starred) { - // We don't have a visible star to click in the window. - NOTREACHED(); -} - -void HtmlDialogView::UpdateTargetURL(TabContents* source, const GURL& url) { - // Ignored. -} - -//////////////////////////////////////////////////////////////////////////////// // HtmlDialogView: void HtmlDialogView::InitDialog() { diff --git a/chrome/browser/views/html_dialog_view.h b/chrome/browser/views/html_dialog_view.h index 2f3eb58..b886d1e 100644 --- a/chrome/browser/views/html_dialog_view.h +++ b/chrome/browser/views/html_dialog_view.h @@ -29,12 +29,10 @@ class Window; //////////////////////////////////////////////////////////////////////////////// class HtmlDialogView : public DOMView, - public TabContentsDelegate, public HtmlDialogUIDelegate, public views::WindowDelegate { public: - HtmlDialogView(Browser* parent_browser, - Profile* profile, + HtmlDialogView(Profile* profile, HtmlDialogUIDelegate* delegate); virtual ~HtmlDialogView(); @@ -59,34 +57,7 @@ class HtmlDialogView virtual void GetDialogSize(gfx::Size* size) const; virtual std::string GetDialogArgs() const; 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 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 |