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

Side by Side Diff: chrome/browser/profiles/profile_window.cc

Issue 18615010: Refactor utility methods out of the ProfileManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unbreak rebase and added new static fn from trunk Created 7 years, 5 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 | « chrome/browser/profiles/profile_window.h ('k') | chrome/browser/profiles/profiles_state.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/profiles/profile_window.h"
6
7 #include "base/command_line.h"
8 #include "base/files/file_path.h"
9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/browser.h"
11 #include "content/public/browser/user_metrics.h"
12
13 #if !defined(OS_IOS)
14 #include "chrome/browser/ui/browser_finder.h"
15 #include "chrome/browser/ui/browser_window.h"
16 #include "chrome/browser/ui/startup/startup_browser_creator.h"
17 #endif // !defined (OS_IOS)
18
19 using content::UserMetricsAction;
20
21 namespace profiles {
22
23 void FindOrCreateNewWindowForProfile(
24 Profile* profile,
25 chrome::startup::IsProcessStartup process_startup,
26 chrome::startup::IsFirstRun is_first_run,
27 chrome::HostDesktopType desktop_type,
28 bool always_create) {
29 #if defined(OS_IOS)
30 NOTREACHED();
31 #else
32 DCHECK(profile);
33
34 if (!always_create) {
35 Browser* browser = chrome::FindTabbedBrowser(profile, false, desktop_type);
36 if (browser) {
37 browser->window()->Activate();
38 return;
39 }
40 }
41
42 content::RecordAction(UserMetricsAction("NewWindow"));
43 CommandLine command_line(CommandLine::NO_PROGRAM);
44 int return_code;
45 StartupBrowserCreator browser_creator;
46 browser_creator.LaunchBrowser(command_line, profile, base::FilePath(),
47 process_startup, is_first_run, &return_code);
48 #endif // defined(OS_IOS)
49 }
50
51 } // namespace profiles
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_window.h ('k') | chrome/browser/profiles/profiles_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698