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

Unified Diff: trunk/src/chrome/browser/ui/apps/chrome_shell_window_delegate.cc

Issue 164613002: Revert 251094 "Revert 250826 "Remove Profile dependency from app..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: trunk/src/chrome/browser/ui/apps/chrome_shell_window_delegate.cc
===================================================================
--- trunk/src/chrome/browser/ui/apps/chrome_shell_window_delegate.cc (revision 251111)
+++ trunk/src/chrome/browser/ui/apps/chrome_shell_window_delegate.cc (working copy)
@@ -9,6 +9,7 @@
#include "chrome/browser/file_select_helper.h"
#include "chrome/browser/media/media_capture_devices_dispatcher.h"
#include "chrome/browser/platform_util.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/shell_integration.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_dialogs.h"
@@ -16,6 +17,7 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
#include "chrome/common/render_messages.h"
+#include "content/public/browser/browser_context.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
@@ -39,7 +41,7 @@
// Opens a URL with Chromium (not external browser) with the right profile.
content::WebContents* OpenURLFromTabInternal(
- Profile* profile,
+ content::BrowserContext* context,
content::WebContents* source,
const content::OpenURLParams& params) {
// Force all links to open in a new tab, even if they were trying to open a
@@ -49,7 +51,7 @@
new_tab_params.disposition = params.disposition == NEW_BACKGROUND_TAB
? params.disposition
: NEW_FOREGROUND_TAB;
- new_tab_params.initiating_profile = profile;
+ new_tab_params.initiating_profile = Profile::FromBrowserContext(context);
chrome::Navigate(&new_tab_params);
return new_tab_params.target_contents;
@@ -148,14 +150,14 @@
}
content::WebContents* ChromeShellWindowDelegate::OpenURLFromTab(
- Profile* profile,
+ content::BrowserContext* context,
content::WebContents* source,
const content::OpenURLParams& params) {
- return OpenURLFromTabInternal(profile, source, params);
+ return OpenURLFromTabInternal(context, source, params);
}
void ChromeShellWindowDelegate::AddNewContents(
- Profile* profile,
+ content::BrowserContext* context,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
@@ -168,7 +170,7 @@
return;
}
chrome::ScopedTabbedBrowserDisplayer displayer(
- profile, chrome::GetActiveDesktop());
+ Profile::FromBrowserContext(context), chrome::GetActiveDesktop());
// Force all links to open in a new tab, even if they were trying to open a
// new window.
disposition =

Powered by Google App Engine
This is Rietveld 408576698