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

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

Issue 163913004: Revert 250826 "Remove Profile dependency from apps::ShellWindow" (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 251093)
+++ trunk/src/chrome/browser/ui/apps/chrome_shell_window_delegate.cc (working copy)
@@ -9,7 +9,6 @@
#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"
@@ -17,7 +16,6 @@
#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"
@@ -41,7 +39,7 @@
// Opens a URL with Chromium (not external browser) with the right profile.
content::WebContents* OpenURLFromTabInternal(
- content::BrowserContext* context,
+ Profile* profile,
content::WebContents* source,
const content::OpenURLParams& params) {
// Force all links to open in a new tab, even if they were trying to open a
@@ -51,7 +49,7 @@
new_tab_params.disposition = params.disposition == NEW_BACKGROUND_TAB
? params.disposition
: NEW_FOREGROUND_TAB;
- new_tab_params.initiating_profile = Profile::FromBrowserContext(context);
+ new_tab_params.initiating_profile = profile;
chrome::Navigate(&new_tab_params);
return new_tab_params.target_contents;
@@ -150,14 +148,14 @@
}
content::WebContents* ChromeShellWindowDelegate::OpenURLFromTab(
- content::BrowserContext* context,
+ Profile* profile,
content::WebContents* source,
const content::OpenURLParams& params) {
- return OpenURLFromTabInternal(context, source, params);
+ return OpenURLFromTabInternal(profile, source, params);
}
void ChromeShellWindowDelegate::AddNewContents(
- content::BrowserContext* context,
+ Profile* profile,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
@@ -170,7 +168,7 @@
return;
}
chrome::ScopedTabbedBrowserDisplayer displayer(
- Profile::FromBrowserContext(context), chrome::GetActiveDesktop());
+ profile, 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