diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-19 00:34:25 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-19 00:34:25 +0000 |
commit | 2f69b38816cc86ffff8c255a6984376e2aa02c10 (patch) | |
tree | f02519424110456ccda1563e9bee6e32aa78fc56 /chrome/browser/dom_ui/constrained_html_ui.cc | |
parent | 7b398be3d0a34cb44dff6c45a6842f4ab4c1116e (diff) | |
download | chromium_src-2f69b38816cc86ffff8c255a6984376e2aa02c10.zip chromium_src-2f69b38816cc86ffff8c255a6984376e2aa02c10.tar.gz chromium_src-2f69b38816cc86ffff8c255a6984376e2aa02c10.tar.bz2 |
Reland "WebUI: Move more files from chrome/browser/dom_ui to chrome/browser/webui. Part 5."
This reverts commit 1088003ee7026f2b830d2451f79ce772c44a7cea.
BUG=59945, 59946
TEST=trybots
TBR=avi@chromium.org
Original Review: http://codereview.chromium.org/6538053/
Review URL: http://codereview.chromium.org/6532069
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75478 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui/constrained_html_ui.cc')
-rw-r--r-- | chrome/browser/dom_ui/constrained_html_ui.cc | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/chrome/browser/dom_ui/constrained_html_ui.cc b/chrome/browser/dom_ui/constrained_html_ui.cc deleted file mode 100644 index 494199f..0000000 --- a/chrome/browser/dom_ui/constrained_html_ui.cc +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) 2011 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/dom_ui/constrained_html_ui.h" - -#include "base/lazy_instance.h" -#include "chrome/browser/dom_ui/html_dialog_ui.h" -#include "chrome/browser/renderer_host/render_view_host.h" -#include "chrome/browser/tab_contents/tab_contents.h" -#include "chrome/browser/webui/web_ui_util.h" -#include "chrome/common/bindings_policy.h" - -static base::LazyInstance<PropertyAccessor<ConstrainedHtmlUIDelegate*> > - g_constrained_html_ui_property_accessor(base::LINKER_INITIALIZED); - -ConstrainedHtmlUI::ConstrainedHtmlUI(TabContents* contents) - : WebUI(contents) { -} - -ConstrainedHtmlUI::~ConstrainedHtmlUI() { -} - -void ConstrainedHtmlUI::RenderViewCreated( - RenderViewHost* render_view_host) { - ConstrainedHtmlUIDelegate* delegate = GetConstrainedDelegate(); - if (!delegate) - return; - - HtmlDialogUIDelegate* dialog_delegate = delegate->GetHtmlDialogUIDelegate(); - std::vector<WebUIMessageHandler*> handlers; - dialog_delegate->GetWebUIMessageHandlers(&handlers); - render_view_host->SetWebUIProperty("dialogArguments", - dialog_delegate->GetDialogArgs()); - for (std::vector<WebUIMessageHandler*>::iterator it = handlers.begin(); - it != handlers.end(); ++it) { - (*it)->Attach(this); - AddMessageHandler(*it); - } - - // Add a "DialogClose" callback which matches HTMLDialogUI behavior. - RegisterMessageCallback("DialogClose", - NewCallback(this, &ConstrainedHtmlUI::OnDialogClose)); -} - -void ConstrainedHtmlUI::OnDialogClose(const ListValue* args) { - ConstrainedHtmlUIDelegate* delegate = GetConstrainedDelegate(); - if (!delegate) - return; - - delegate->GetHtmlDialogUIDelegate()->OnDialogClosed( - web_ui_util::GetJsonResponseFromFirstArgumentInList(args)); - delegate->OnDialogClose(); -} - -ConstrainedHtmlUIDelegate* - ConstrainedHtmlUI::GetConstrainedDelegate() { - ConstrainedHtmlUIDelegate** property = - GetPropertyAccessor().GetProperty(tab_contents()->property_bag()); - return property ? *property : NULL; -} - -// static -PropertyAccessor<ConstrainedHtmlUIDelegate*>& - ConstrainedHtmlUI::GetPropertyAccessor() { - return g_constrained_html_ui_property_accessor.Get(); -} |