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

Side by Side Diff: chrome/browser/ui/browser_navigator.cc

Issue 6296011: Fix for regression: Any window of type APP should create APP_POPUP windows. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Add BrowserNavigatorTest.Disposition_NewPopupFromAppPopup Created 9 years, 11 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 | chrome/browser/ui/browser_navigator_browsertest.cc » ('j') | 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) 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/ui/browser_navigator.h" 5 #include "chrome/browser/ui/browser_navigator.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/browser_list.h" 8 #include "chrome/browser/browser_list.h"
9 #include "chrome/browser/browser_url_handler.h" 9 #include "chrome/browser/browser_url_handler.h"
10 #include "chrome/browser/browser_window.h" 10 #include "chrome/browser/browser_window.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 return params->browser; 154 return params->browser;
155 // Find a compatible window and re-execute this command in it. Otherwise 155 // Find a compatible window and re-execute this command in it. Otherwise
156 // re-run with NEW_WINDOW. 156 // re-run with NEW_WINDOW.
157 if (profile) 157 if (profile)
158 return GetOrCreateBrowser(profile); 158 return GetOrCreateBrowser(profile);
159 return NULL; 159 return NULL;
160 case NEW_POPUP: { 160 case NEW_POPUP: {
161 // Make a new popup window. Coerce app-style if |params->browser| or the 161 // Make a new popup window. Coerce app-style if |params->browser| or the
162 // |source| represents an app. 162 // |source| represents an app.
163 Browser::Type type = Browser::TYPE_POPUP; 163 Browser::Type type = Browser::TYPE_POPUP;
164 if ((params->browser && params->browser->type() == Browser::TYPE_APP) || 164 if ((params->browser && (params->browser->type() & Browser::TYPE_APP)) ||
165 (params->source_contents && 165 (params->source_contents && params->source_contents->is_app())) {
166 params->source_contents->is_app())) {
167 type = Browser::TYPE_APP_POPUP; 166 type = Browser::TYPE_APP_POPUP;
168 } 167 }
169 if (profile) { 168 if (profile) {
170 Browser* browser = new Browser(type, profile); 169 Browser* browser = new Browser(type, profile);
171 browser->set_override_bounds(params->window_bounds); 170 browser->set_override_bounds(params->window_bounds);
172 browser->CreateBrowserWindow(); 171 browser->CreateBrowserWindow();
173 return browser; 172 return browser;
174 } 173 }
175 return NULL; 174 return NULL;
176 } 175 }
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 params->url, params->referrer, params->transition); 468 params->url, params->referrer, params->transition);
470 } 469 }
471 470
472 // If the singleton tab isn't already selected, select it. 471 // If the singleton tab isn't already selected, select it.
473 if (params->source_contents != params->target_contents) 472 if (params->source_contents != params->target_contents)
474 params->browser->SelectTabContentsAt(singleton_index, user_initiated); 473 params->browser->SelectTabContentsAt(singleton_index, user_initiated);
475 } 474 }
476 } 475 }
477 476
478 } // namespace browser 477 } // namespace browser
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/browser_navigator_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698