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

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

Issue 2864213002: [MD Bookmarks] Fix crash when opening a chrome-extension:// URL. (Closed)
Patch Set: Created 3 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
« 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_tab_util.h" 5 #include "chrome/browser/extensions/extension_tab_util.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 208
209 // Default to not pinning the tab. Setting the 'pinned' property to true 209 // Default to not pinning the tab. Setting the 'pinned' property to true
210 // will override this default. 210 // will override this default.
211 bool pinned = false; 211 bool pinned = false;
212 if (params.pinned.get()) 212 if (params.pinned.get())
213 pinned = *params.pinned; 213 pinned = *params.pinned;
214 214
215 // We can't load extension URLs into incognito windows unless the extension 215 // We can't load extension URLs into incognito windows unless the extension
216 // uses split mode. Special case to fall back to a tabbed window. 216 // uses split mode. Special case to fall back to a tabbed window.
217 if (url.SchemeIs(kExtensionScheme) && 217 if (url.SchemeIs(kExtensionScheme) &&
218 !IncognitoInfo::IsSplitMode(function->extension()) && 218 (!function->extension() ||
benwells 2017/05/22 02:59:31 I would have thought (function->extension &&... wo
calamity 2017/05/22 03:02:32 I think we want to hit the fallback behavior in th
benwells 2017/05/22 05:29:43 OK ... so like !(function->extension() && function
219 !IncognitoInfo::IsSplitMode(function->extension())) &&
219 browser->profile()->IsOffTheRecord()) { 220 browser->profile()->IsOffTheRecord()) {
220 Profile* profile = browser->profile()->GetOriginalProfile(); 221 Profile* profile = browser->profile()->GetOriginalProfile();
221 222
222 browser = chrome::FindTabbedBrowser(profile, false); 223 browser = chrome::FindTabbedBrowser(profile, false);
223 if (!browser) { 224 if (!browser) {
224 Browser::CreateParams params = 225 Browser::CreateParams params =
225 Browser::CreateParams(Browser::TYPE_TABBED, profile, user_gesture); 226 Browser::CreateParams(Browser::TYPE_TABBED, profile, user_gesture);
226 browser = new Browser(params); 227 browser = new Browser(params);
227 browser->window()->Show(); 228 browser->window()->Show();
228 } 229 }
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 chrome::ShowSingletonTabOverwritingNTP(browser, params); 716 chrome::ShowSingletonTabOverwritingNTP(browser, params);
716 return true; 717 return true;
717 } 718 }
718 719
719 // static 720 // static
720 bool ExtensionTabUtil::BrowserSupportsTabs(Browser* browser) { 721 bool ExtensionTabUtil::BrowserSupportsTabs(Browser* browser) {
721 return browser && browser->tab_strip_model() && !browser->is_devtools(); 722 return browser && browser->tab_strip_model() && !browser->is_devtools();
722 } 723 }
723 724
724 } // namespace extensions 725 } // namespace extensions
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