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

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

Issue 157813007: Remove Profile dependency from apps::ShellWindow (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test 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: chrome/browser/ui/apps/chrome_shell_window_delegate.cc
diff --git a/chrome/browser/ui/apps/chrome_shell_window_delegate.cc b/chrome/browser/ui/apps/chrome_shell_window_delegate.cc
index 4d12672820853bfe63b1692cb0b77d62e0deb152..30e83bd12f569ac5a07650c880d23fabdf6aa039 100644
--- a/chrome/browser/ui/apps/chrome_shell_window_delegate.cc
+++ b/chrome/browser/ui/apps/chrome_shell_window_delegate.cc
@@ -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 @@ bool disable_external_open_for_testing_ = false;
// 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 @@ content::WebContents* OpenURLFromTabInternal(
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 @@ apps::NativeAppWindow* ChromeShellWindowDelegate::CreateNativeAppWindow(
}
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 @@ void ChromeShellWindowDelegate::AddNewContents(
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