Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: chrome/browser/extensions/extension_host.cc

Issue 7037040: Extension in background unable to open window if there is no browser running. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 return; 591 return;
592 592
593 if (disposition == NEW_POPUP) { 593 if (disposition == NEW_POPUP) {
594 // Find a browser with a matching profile for creating a popup. 594 // Find a browser with a matching profile for creating a popup.
595 // (If none is found, NULL argument to NavigateParams is valid.) 595 // (If none is found, NULL argument to NavigateParams is valid.)
596 Browser* browser = BrowserList::FindTabbedBrowser( 596 Browser* browser = BrowserList::FindTabbedBrowser(
597 contents->profile(), 597 contents->profile(),
598 false); // Match incognito exactly. 598 false); // Match incognito exactly.
599 TabContentsWrapper* wrapper = new TabContentsWrapper(contents); 599 TabContentsWrapper* wrapper = new TabContentsWrapper(contents);
600 browser::NavigateParams params(browser, wrapper); 600 browser::NavigateParams params(browser, wrapper);
601 if (!browser)
Matt Perry 2011/05/19 00:50:32 Does it make sense to set the profile even if brow
prasadt 2011/05/19 00:58:18 I'm not really sure and tried to make the fix affe
Matt Perry 2011/05/19 01:01:32 Fair enough.
602 params.profile = contents->profile();
601 params.disposition = NEW_POPUP; 603 params.disposition = NEW_POPUP;
602 params.window_bounds = initial_pos; 604 params.window_bounds = initial_pos;
603 params.window_action = browser::NavigateParams::SHOW_WINDOW; 605 params.window_action = browser::NavigateParams::SHOW_WINDOW;
604 params.user_gesture = user_gesture; 606 params.user_gesture = user_gesture;
605 browser::Navigate(&params); 607 browser::Navigate(&params);
606 return; 608 return;
607 } 609 }
608 610
609 // If the tab contents isn't a popup, it's a normal tab. We need to find a 611 // If the tab contents isn't a popup, it's a normal tab. We need to find a
610 // home for it. This is typically a Browser, but it can also be some other 612 // home for it. This is typically a Browser, but it can also be some other
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 return window_id; 829 return window_id;
828 } 830 }
829 831
830 void ExtensionHost::OnRunFileChooser( 832 void ExtensionHost::OnRunFileChooser(
831 const ViewHostMsg_RunFileChooser_Params& params) { 833 const ViewHostMsg_RunFileChooser_Params& params) {
832 if (file_select_helper_.get() == NULL) 834 if (file_select_helper_.get() == NULL)
833 file_select_helper_.reset(new FileSelectHelper(profile())); 835 file_select_helper_.reset(new FileSelectHelper(profile()));
834 file_select_helper_->RunFileChooser(render_view_host_, 836 file_select_helper_->RunFileChooser(render_view_host_,
835 associated_tab_contents(), params); 837 associated_tab_contents(), params);
836 } 838 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698