| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 virtual void GetDialogSize(gfx::Size* size) const { | 320 virtual void GetDialogSize(gfx::Size* size) const { |
| 321 size->set_width(params_.width); | 321 size->set_width(params_.width); |
| 322 size->set_height(params_.height); | 322 size->set_height(params_.height); |
| 323 } | 323 } |
| 324 virtual std::string GetDialogArgs() const { return params_.json_input; } | 324 virtual std::string GetDialogArgs() const { return params_.json_input; } |
| 325 virtual void OnDialogClosed(const std::string& json_retval) { | 325 virtual void OnDialogClosed(const std::string& json_retval) { |
| 326 io_message_loop_->PostTask(FROM_HERE, NewRunnableMethod( | 326 io_message_loop_->PostTask(FROM_HERE, NewRunnableMethod( |
| 327 this, &ModelessHtmlDialogDelegate::ReportResults, json_retval)); | 327 this, &ModelessHtmlDialogDelegate::ReportResults, json_retval)); |
| 328 } | 328 } |
| 329 virtual void OnCloseContents(TabContents* source, bool* out_close_dialog) { } | 329 virtual void OnCloseContents(TabContents* source, bool* out_close_dialog) { } |
| 330 virtual bool ShouldShowDialogTitle() const { return true; } |
| 330 | 331 |
| 331 private: | 332 private: |
| 332 // Actually shows the dialog on the UI thread. | 333 // Actually shows the dialog on the UI thread. |
| 333 void Show() { | 334 void Show() { |
| 334 DCHECK(MessageLoop::current() == main_message_loop_); | 335 DCHECK(MessageLoop::current() == main_message_loop_); |
| 335 Browser* browser = BrowserList::GetLastActive(); | 336 Browser* browser = BrowserList::GetLastActive(); |
| 336 browser->BrowserShowHtmlDialog(this, parent_wnd_); | 337 browser->BrowserShowHtmlDialog(this, parent_wnd_); |
| 337 } | 338 } |
| 338 | 339 |
| 339 // Gives the JSON result string back to the plugin. | 340 // Gives the JSON result string back to the plugin. |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 823 CPBrowsingContext context) { | 824 CPBrowsingContext context) { |
| 824 // Sadly if we try and pass context through, we seem to break cl's little | 825 // Sadly if we try and pass context through, we seem to break cl's little |
| 825 // brain trying to compile the Tuple3 ctor. This cast works. | 826 // brain trying to compile the Tuple3 ctor. This cast works. |
| 826 int32 context_as_int32 = static_cast<int32>(context); | 827 int32 context_as_int32 = static_cast<int32>(context); |
| 827 // Plugins can only be accessed on the IO thread. | 828 // Plugins can only be accessed on the IO thread. |
| 828 BrowserThread::PostTask( | 829 BrowserThread::PostTask( |
| 829 BrowserThread::IO, FROM_HERE, | 830 BrowserThread::IO, FROM_HERE, |
| 830 NewRunnableFunction(PluginCommandHandler::HandleCommand, | 831 NewRunnableFunction(PluginCommandHandler::HandleCommand, |
| 831 command, data, context_as_int32)); | 832 command, data, context_as_int32)); |
| 832 } | 833 } |
| OLD | NEW |