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

Unified Diff: chrome/browser/ui/webui/html_dialog_controller.cc

Issue 10214001: WebDialogs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 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/html_dialog_controller.cc
===================================================================
--- chrome/browser/ui/webui/html_dialog_controller.cc (revision 133969)
+++ chrome/browser/ui/webui/html_dialog_controller.cc (working copy)
@@ -1,44 +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.
-
-#include "chrome/browser/ui/webui/html_dialog_controller.h"
-
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/common/chrome_notification_types.h"
-#include "content/public/browser/notification_service.h"
-#include "content/public/browser/notification_source.h"
-
-HtmlDialogController::HtmlDialogController(HtmlDialogUIDelegate* delegate,
- Profile* profile,
- Browser* browser)
- : dialog_delegate_(delegate) {
- // It's only safe to show an off the record profile under one of two
- // circumstances:
- // 1. For a modal dialog where the parent will maintain the profile.
- // 2. If we have a browser which will keep the reference to this profile
- // alive. The dialog will be closed if this browser is closed.
- DCHECK(!profile->IsOffTheRecord() ||
- delegate->GetDialogModalType() != ui::MODAL_TYPE_NONE ||
- (browser && browser->profile() == profile));
- // If we're passed a browser it should own the profile we're using.
- DCHECK(!browser || browser->profile() == profile);
- if (browser) {
- registrar_.Add(this,
- chrome::NOTIFICATION_BROWSER_CLOSING,
- content::Source<Browser>(browser));
- }
-}
-
-// content::NotificationObserver implementation:
-void HtmlDialogController::Observe(
- int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- DCHECK(type == chrome::NOTIFICATION_BROWSER_CLOSING);
-
- // If the browser creating this dialog is closed, close the dialog to prevent
- // using potentially destroyed profiles.
- dialog_delegate_->OnDialogClosed(std::string());
-}
« no previous file with comments | « chrome/browser/ui/webui/html_dialog_controller.h ('k') | chrome/browser/ui/webui/html_dialog_controller_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698