OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/webui/web_dialog_ui.h" | 5 #include "chrome/browser/ui/webui/web_dialog_ui.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/property_bag.h" | 10 #include "base/property_bag.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 } | 67 } |
68 | 68 |
69 if (0 != (web_ui()->GetBindings() & content::BINDINGS_POLICY_WEB_UI)) | 69 if (0 != (web_ui()->GetBindings() & content::BINDINGS_POLICY_WEB_UI)) |
70 render_view_host->SetWebUIProperty("dialogArguments", dialog_args); | 70 render_view_host->SetWebUIProperty("dialogArguments", dialog_args); |
71 for (std::vector<WebUIMessageHandler*>::iterator it = handlers.begin(); | 71 for (std::vector<WebUIMessageHandler*>::iterator it = handlers.begin(); |
72 it != handlers.end(); ++it) { | 72 it != handlers.end(); ++it) { |
73 web_ui()->AddMessageHandler(*it); | 73 web_ui()->AddMessageHandler(*it); |
74 } | 74 } |
75 | 75 |
76 content::NotificationService::current()->Notify( | 76 content::NotificationService::current()->Notify( |
77 chrome::NOTIFICATION_HTML_DIALOG_SHOWN, | 77 chrome::NOTIFICATION_WEB_DIALOG_SHOWN, |
78 content::Source<content::WebUI>(web_ui()), | 78 content::Source<content::WebUI>(web_ui()), |
79 content::Details<RenderViewHost>(render_view_host)); | 79 content::Details<RenderViewHost>(render_view_host)); |
80 } | 80 } |
81 | 81 |
82 void WebDialogUI::OnDialogClosed(const ListValue* args) { | 82 void WebDialogUI::OnDialogClosed(const ListValue* args) { |
83 WebDialogDelegate** delegate = GetPropertyAccessor().GetProperty( | 83 WebDialogDelegate** delegate = GetPropertyAccessor().GetProperty( |
84 web_ui()->GetWebContents()->GetPropertyBag()); | 84 web_ui()->GetWebContents()->GetPropertyBag()); |
85 if (delegate) { | 85 if (delegate) { |
86 std::string json_retval; | 86 std::string json_retval; |
87 if (args && !args->empty() && !args->GetString(0, &json_retval)) | 87 if (args && !args->empty() && !args->GetString(0, &json_retval)) |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 } | 124 } |
125 | 125 |
126 bool WebDialogDelegate::HandleAddNewContents( | 126 bool WebDialogDelegate::HandleAddNewContents( |
127 content::WebContents* source, | 127 content::WebContents* source, |
128 content::WebContents* new_contents, | 128 content::WebContents* new_contents, |
129 WindowOpenDisposition disposition, | 129 WindowOpenDisposition disposition, |
130 const gfx::Rect& initial_pos, | 130 const gfx::Rect& initial_pos, |
131 bool user_gesture) { | 131 bool user_gesture) { |
132 return false; | 132 return false; |
133 } | 133 } |
OLD | NEW |