Chromium Code Reviews| 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 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 579 if (disposition == NEW_POPUP) { | 579 if (disposition == NEW_POPUP) { |
| 580 // Find a browser with a matching profile for creating a popup. | 580 // Find a browser with a matching profile for creating a popup. |
| 581 // (If none is found, NULL argument to NavigateParams is valid.) | 581 // (If none is found, NULL argument to NavigateParams is valid.) |
| 582 Browser* browser = BrowserList::FindTabbedBrowser( | 582 Browser* browser = BrowserList::FindTabbedBrowser( |
| 583 contents->profile(), | 583 contents->profile(), |
| 584 false); // Match incognito exactly. | 584 false); // Match incognito exactly. |
| 585 TabContentsWrapper* wrapper = new TabContentsWrapper(contents); | 585 TabContentsWrapper* wrapper = new TabContentsWrapper(contents); |
| 586 browser::NavigateParams params(browser, wrapper); | 586 browser::NavigateParams params(browser, wrapper); |
| 587 if (!browser) | 587 if (!browser) |
| 588 params.profile = contents->profile(); | 588 params.profile = contents->profile(); |
| 589 params.extension_app_id = extension_id_; | |
|
Erik does not do reviews
2011/05/25 15:13:03
I forget the semantics of ShowCreatedWindow in thi
prasadt
2011/05/25 17:53:00
This is called for any URL opened with window.open
| |
| 589 params.disposition = NEW_POPUP; | 590 params.disposition = NEW_POPUP; |
| 590 params.window_bounds = initial_pos; | 591 params.window_bounds = initial_pos; |
| 591 params.window_action = browser::NavigateParams::SHOW_WINDOW; | 592 params.window_action = browser::NavigateParams::SHOW_WINDOW; |
| 592 params.user_gesture = user_gesture; | 593 params.user_gesture = user_gesture; |
| 593 browser::Navigate(¶ms); | 594 browser::Navigate(¶ms); |
| 594 return; | 595 return; |
| 595 } | 596 } |
| 596 | 597 |
| 597 // If the tab contents isn't a popup, it's a normal tab. We need to find a | 598 // If the tab contents isn't a popup, it's a normal tab. We need to find a |
| 598 // home for it. This is typically a Browser, but it can also be some other | 599 // home for it. This is typically a Browser, but it can also be some other |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 810 return window_id; | 811 return window_id; |
| 811 } | 812 } |
| 812 | 813 |
| 813 void ExtensionHost::OnRunFileChooser( | 814 void ExtensionHost::OnRunFileChooser( |
| 814 const ViewHostMsg_RunFileChooser_Params& params) { | 815 const ViewHostMsg_RunFileChooser_Params& params) { |
| 815 if (file_select_helper_.get() == NULL) | 816 if (file_select_helper_.get() == NULL) |
| 816 file_select_helper_.reset(new FileSelectHelper(profile())); | 817 file_select_helper_.reset(new FileSelectHelper(profile())); |
| 817 file_select_helper_->RunFileChooser(render_view_host_, | 818 file_select_helper_->RunFileChooser(render_view_host_, |
| 818 GetAssociatedTabContents(), params); | 819 GetAssociatedTabContents(), params); |
| 819 } | 820 } |
| OLD | NEW |