Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3167)

Unified Diff: chrome/browser/ui/webui/web_dialog_web_contents_delegate.h

Issue 10796049: Move WebDialogWebContentsDelegate to ui/web_dialogs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/web_dialog_web_contents_delegate.h
diff --git a/chrome/browser/ui/webui/web_dialog_web_contents_delegate.h b/chrome/browser/ui/webui/web_dialog_web_contents_delegate.h
deleted file mode 100644
index a0dd2a9bec173a7c85c4118ec2c23d2d28f7f052..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/webui/web_dialog_web_contents_delegate.h
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright (c) 2012 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 CHROME_BROWSER_UI_WEBUI_WEB_DIALOG_WEB_CONTENTS_DELEGATE_H_
-#define CHROME_BROWSER_UI_WEBUI_WEB_DIALOG_WEB_CONTENTS_DELEGATE_H_
-
-#include "base/compiler_specific.h"
-#include "content/public/browser/web_contents_delegate.h"
-
-// This class implements (and mostly ignores) most of
-// content::WebContentsDelegate for use in a Web dialog. Subclasses need only
-// override a few methods instead of the everything from
-// content::WebContentsDelegate; this way, implementations on all platforms
-// behave consistently.
-class WebDialogWebContentsDelegate : public content::WebContentsDelegate {
- public:
- // Handles OpenURLFromTab and AddNewContents for WebDialogWebContentsDelegate.
- class WebContentsHandler {
- public:
- virtual ~WebContentsHandler() {}
- virtual content::WebContents* OpenURLFromTab(
- content::BrowserContext* context,
- content::WebContents* source,
- const content::OpenURLParams& params) = 0;
- virtual void AddNewContents(content::BrowserContext* context,
- content::WebContents* source,
- content::WebContents* new_contents,
- WindowOpenDisposition disposition,
- const gfx::Rect& initial_pos,
- bool user_gesture) = 0;
- };
-
- // context and handler must be non-NULL.
- // Takes the ownership of handler.
- WebDialogWebContentsDelegate(content::BrowserContext* context,
- WebContentsHandler* handler);
-
- virtual ~WebDialogWebContentsDelegate();
-
- // The returned browser context is guaranteed to be original if non-NULL.
- content::BrowserContext* browser_context() const {
- return browser_context_;
- }
-
- // Calling this causes all following events sent from the
- // WebContents object to be ignored. It also makes all following
- // calls to browser_context() return NULL.
- void Detach();
-
- // content::WebContentsDelegate declarations.
- virtual content::WebContents* OpenURLFromTab(
- content::WebContents* source,
- const content::OpenURLParams& params) OVERRIDE;
-
- virtual void AddNewContents(content::WebContents* source,
- content::WebContents* new_contents,
- WindowOpenDisposition disposition,
- const gfx::Rect& initial_pos,
- bool user_gesture) OVERRIDE;
- virtual bool IsPopupOrPanel(
- const content::WebContents* source) const OVERRIDE;
- virtual bool ShouldAddNavigationToHistory(
- const history::HistoryAddPageArgs& add_page_args,
- content::NavigationType navigation_type) OVERRIDE;
-
- private:
- // Weak pointer. Always an original profile.
- content::BrowserContext* browser_context_;
-
- scoped_ptr<WebContentsHandler> handler_;
-
- DISALLOW_COPY_AND_ASSIGN(WebDialogWebContentsDelegate);
-};
-
-#endif // CHROME_BROWSER_UI_WEBUI_WEB_DIALOG_WEB_CONTENTS_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698