OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extensions/extension_host.h" | 5 #include "chrome/browser/extensions/extension_host.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 render_view_host_, true); | 471 render_view_host_, true); |
472 if (browser) { | 472 if (browser) { |
473 TabContents* active_tab = browser->GetSelectedTabContents(); | 473 TabContents* active_tab = browser->GetSelectedTabContents(); |
474 if (active_tab) | 474 if (active_tab) |
475 return active_tab->view()->GetTopLevelNativeWindow(); | 475 return active_tab->view()->GetTopLevelNativeWindow(); |
476 } | 476 } |
477 | 477 |
478 return NULL; | 478 return NULL; |
479 } | 479 } |
480 | 480 |
481 TabContents* ExtensionHost::AsTabContents() { | |
482 return NULL; | |
483 } | |
484 | |
485 ExtensionHost* ExtensionHost::AsExtensionHost() { | |
486 return this; | |
487 } | |
488 | |
489 void ExtensionHost::OnDialogClosed(IPC::Message* reply_msg, | 481 void ExtensionHost::OnDialogClosed(IPC::Message* reply_msg, |
490 bool success, | 482 bool success, |
491 const string16& user_input) { | 483 const string16& user_input) { |
492 render_view_host()->JavaScriptDialogClosed(reply_msg, | 484 render_view_host()->JavaScriptDialogClosed(reply_msg, |
493 success, | 485 success, |
494 user_input); | 486 user_input); |
495 } | 487 } |
496 | 488 |
497 void ExtensionHost::Close(RenderViewHost* render_view_host) { | 489 void ExtensionHost::Close(RenderViewHost* render_view_host) { |
498 if (extension_host_type_ == ViewType::EXTENSION_POPUP || | 490 if (extension_host_type_ == ViewType::EXTENSION_POPUP || |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 } | 803 } |
812 } | 804 } |
813 | 805 |
814 void ExtensionHost::OnRunFileChooser( | 806 void ExtensionHost::OnRunFileChooser( |
815 const ViewHostMsg_RunFileChooser_Params& params) { | 807 const ViewHostMsg_RunFileChooser_Params& params) { |
816 if (file_select_helper_.get() == NULL) | 808 if (file_select_helper_.get() == NULL) |
817 file_select_helper_.reset(new FileSelectHelper(profile())); | 809 file_select_helper_.reset(new FileSelectHelper(profile())); |
818 file_select_helper_->RunFileChooser(render_view_host_, | 810 file_select_helper_->RunFileChooser(render_view_host_, |
819 GetAssociatedTabContents(), params); | 811 GetAssociatedTabContents(), params); |
820 } | 812 } |
OLD | NEW |