| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/chrome_plugin_host.h" | 5 #include "chrome/browser/chrome_plugin_host.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 ~ModelessHtmlDialogDelegate() { | 306 ~ModelessHtmlDialogDelegate() { |
| 307 DCHECK(ChromePluginLib::IsPluginThread()); | 307 DCHECK(ChromePluginLib::IsPluginThread()); |
| 308 } | 308 } |
| 309 | 309 |
| 310 // The following public methods are called from the UI thread. | 310 // The following public methods are called from the UI thread. |
| 311 | 311 |
| 312 // HtmlDialogUIDelegate implementation: | 312 // HtmlDialogUIDelegate implementation: |
| 313 virtual bool IsDialogModal() const { return false; } | 313 virtual bool IsDialogModal() const { return false; } |
| 314 virtual std::wstring GetDialogTitle() const { return L"Gears"; } | 314 virtual std::wstring GetDialogTitle() const { return L"Gears"; } |
| 315 virtual GURL GetDialogContentURL() const { return params_.url; } | 315 virtual GURL GetDialogContentURL() const { return params_.url; } |
| 316 virtual void GetDOMMessageHandlers( |
| 317 std::vector<DOMMessageHandler*>* handlers) const {} |
| 316 virtual void GetDialogSize(gfx::Size* size) const { | 318 virtual void GetDialogSize(gfx::Size* size) const { |
| 317 size->set_width(params_.width); | 319 size->set_width(params_.width); |
| 318 size->set_height(params_.height); | 320 size->set_height(params_.height); |
| 319 } | 321 } |
| 320 virtual std::string GetDialogArgs() const { return params_.json_input; } | 322 virtual std::string GetDialogArgs() const { return params_.json_input; } |
| 321 virtual void OnDialogClosed(const std::string& json_retval) { | 323 virtual void OnDialogClosed(const std::string& json_retval) { |
| 322 io_message_loop_->PostTask(FROM_HERE, NewRunnableMethod( | 324 io_message_loop_->PostTask(FROM_HERE, NewRunnableMethod( |
| 323 this, &ModelessHtmlDialogDelegate::ReportResults, json_retval)); | 325 this, &ModelessHtmlDialogDelegate::ReportResults, json_retval)); |
| 324 } | 326 } |
| 325 | 327 |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 void CPHandleCommand(int command, CPCommandInterface* data, | 812 void CPHandleCommand(int command, CPCommandInterface* data, |
| 811 CPBrowsingContext context) { | 813 CPBrowsingContext context) { |
| 812 // Sadly if we try and pass context through, we seem to break cl's little | 814 // Sadly if we try and pass context through, we seem to break cl's little |
| 813 // brain trying to compile the Tuple3 ctor. This cast works. | 815 // brain trying to compile the Tuple3 ctor. This cast works. |
| 814 int32 context_as_int32 = static_cast<int32>(context); | 816 int32 context_as_int32 = static_cast<int32>(context); |
| 815 // Plugins can only be accessed on the IO thread. | 817 // Plugins can only be accessed on the IO thread. |
| 816 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, | 818 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, |
| 817 NewRunnableFunction(PluginCommandHandler::HandleCommand, | 819 NewRunnableFunction(PluginCommandHandler::HandleCommand, |
| 818 command, data, context_as_int32)); | 820 command, data, context_as_int32)); |
| 819 } | 821 } |
| OLD | NEW |