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

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

Issue 4090011: Fix bug with context menus in incognito mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: manifest fix Created 10 years, 1 month 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
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/extensions/extension_tabs_module.h" 5 #include "chrome/browser/extensions/extension_tabs_module.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 } 593 }
594 } 594 }
595 595
596 // Default to foreground for the new tab. The presence of 'selected' property 596 // Default to foreground for the new tab. The presence of 'selected' property
597 // will override this default. 597 // will override this default.
598 bool selected = true; 598 bool selected = true;
599 if (args->HasKey(keys::kSelectedKey)) 599 if (args->HasKey(keys::kSelectedKey))
600 EXTENSION_FUNCTION_VALIDATE(args->GetBoolean(keys::kSelectedKey, 600 EXTENSION_FUNCTION_VALIDATE(args->GetBoolean(keys::kSelectedKey,
601 &selected)); 601 &selected));
602 602
603 // We can't load extension URLs into incognito windows. Special case to 603 // We can't load extension URLs into incognito windows unless the extension
604 // fall back to a normal window. 604 // uses split mode. Special case to fall back to a normal window.
605 if (url.SchemeIs(chrome::kExtensionScheme) && 605 if (url.SchemeIs(chrome::kExtensionScheme) &&
606 !GetExtension()->incognito_split_mode() &&
606 browser->profile()->IsOffTheRecord()) { 607 browser->profile()->IsOffTheRecord()) {
607 Profile* profile = browser->profile()->GetOriginalProfile(); 608 Profile* profile = browser->profile()->GetOriginalProfile();
608 browser = BrowserList::FindBrowserWithType(profile, 609 browser = BrowserList::FindBrowserWithType(profile,
609 Browser::TYPE_NORMAL, false); 610 Browser::TYPE_NORMAL, false);
610 if (!browser) { 611 if (!browser) {
611 browser = Browser::Create(profile); 612 browser = Browser::Create(profile);
612 browser->window()->Show(); 613 browser->window()->Show();
613 } 614 }
614 } 615 }
615 616
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
1149 } 1150 }
1150 1151
1151 static GURL ResolvePossiblyRelativeURL(std::string url_string, 1152 static GURL ResolvePossiblyRelativeURL(std::string url_string,
1152 const Extension* extension) { 1153 const Extension* extension) {
1153 GURL url = GURL(url_string); 1154 GURL url = GURL(url_string);
1154 if (!url.is_valid()) 1155 if (!url.is_valid())
1155 url = extension->GetResourceURL(url_string); 1156 url = extension->GetResourceURL(url_string);
1156 1157
1157 return url; 1158 return url;
1158 } 1159 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698