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

Unified Diff: chrome/browser/ui/web_contents_modal_dialog_manager.h

Issue 14969012: components: Create web_modal component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-before-land Created 7 years, 7 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/web_contents_modal_dialog_manager.h
diff --git a/chrome/browser/ui/web_contents_modal_dialog_manager.h b/chrome/browser/ui/web_contents_modal_dialog_manager.h
deleted file mode 100644
index 0e203b2f5ce6ce8872c185c9e45721a16fb18a36..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/web_contents_modal_dialog_manager.h
+++ /dev/null
@@ -1,112 +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_WEB_CONTENTS_MODAL_DIALOG_MANAGER_H_
-#define CHROME_BROWSER_UI_WEB_CONTENTS_MODAL_DIALOG_MANAGER_H_
-
-#include <deque>
-
-#include "base/memory/scoped_ptr.h"
-#include "chrome/browser/ui/native_web_contents_modal_dialog_manager.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
-#include "content/public/browser/web_contents_observer.h"
-#include "content/public/browser/web_contents_user_data.h"
-#include "ui/gfx/native_widget_types.h"
-
-class WebContentsModalDialogManagerDelegate;
-
-// Per-WebContents class to manage WebContents-modal dialogs.
-class WebContentsModalDialogManager
- : public NativeWebContentsModalDialogManagerDelegate,
- public content::WebContentsObserver,
- public content::WebContentsUserData<WebContentsModalDialogManager>,
- public content::NotificationObserver {
- public:
- virtual ~WebContentsModalDialogManager();
-
- WebContentsModalDialogManagerDelegate* delegate() const { return delegate_; }
- void set_delegate(WebContentsModalDialogManagerDelegate* d) { delegate_ = d; }
-
- static NativeWebContentsModalDialogManager* CreateNativeManager(
- NativeWebContentsModalDialogManagerDelegate* native_delegate);
-
- // Shows the dialog as a web contents modal dialog. The dialog will notify via
- // WillClose() when it is being destroyed.
- void ShowDialog(NativeWebContentsModalDialog dialog);
-
- // Returns true if a dialog is currently being shown.
- bool IsShowingDialog() const;
-
- // Focus the topmost modal dialog. IsShowingDialog() must be true when
- // calling this function.
- void FocusTopmostDialog();
-
- // Overriden from NativeWebContentsModalDialogManagerDelegate:
- virtual content::WebContents* GetWebContents() const OVERRIDE;
- // Called when a WebContentsModalDialogs we own is about to be closed.
- virtual void WillClose(NativeWebContentsModalDialog dialog) OVERRIDE;
-
- // content::NotificationObserver overrides
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
- // For testing.
- class TestApi {
- public:
- explicit TestApi(WebContentsModalDialogManager* manager)
- : manager_(manager) {}
-
- void CloseAllDialogs() { manager_->CloseAllDialogs(); }
- void ResetNativeManager(NativeWebContentsModalDialogManager* delegate) {
- manager_->native_manager_.reset(delegate);
- }
-
- private:
- WebContentsModalDialogManager* manager_;
-
- DISALLOW_COPY_AND_ASSIGN(TestApi);
- };
-
- private:
- explicit WebContentsModalDialogManager(content::WebContents* web_contents);
- friend class content::WebContentsUserData<WebContentsModalDialogManager>;
-
- typedef std::deque<NativeWebContentsModalDialog> WebContentsModalDialogList;
-
- // Blocks/unblocks interaction with renderer process.
- void BlockWebContentsInteraction(bool blocked);
-
- bool IsWebContentsVisible() const;
-
- // Closes all WebContentsModalDialogs.
- void CloseAllDialogs();
-
- // Overridden from content::WebContentsObserver:
- virtual void DidNavigateMainFrame(
- const content::LoadCommittedDetails& details,
- const content::FrameNavigateParams& params) OVERRIDE;
- virtual void DidGetIgnoredUIEvent() OVERRIDE;
- virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE;
-
- // Delegate for notifying our owner about stuff. Not owned by us.
- WebContentsModalDialogManagerDelegate* delegate_;
-
- // Delegate for native UI-specific functions on the dialog.
- scoped_ptr<NativeWebContentsModalDialogManager> native_manager_;
-
- // All active dialogs.
- WebContentsModalDialogList child_dialogs_;
-
- // True while closing the dialogs on WebContents close.
- bool closing_all_dialogs_;
-
- // A scoped container for notification registries.
- content::NotificationRegistrar registrar_;
-
- DISALLOW_COPY_AND_ASSIGN(WebContentsModalDialogManager);
-};
-
-#endif // CHROME_BROWSER_UI_WEB_CONTENTS_MODAL_DIALOG_MANAGER_H_
« no previous file with comments | « chrome/browser/ui/web_contents_modal_dialog_host.cc ('k') | chrome/browser/ui/web_contents_modal_dialog_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698