OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/views/athena/chrome_browser_main_extra_parts_athena. h" | 5 #include "chrome/browser/ui/views/athena/chrome_browser_main_extra_parts_athena. h" |
6 | 6 |
7 #include "athena/extensions/public/extensions_delegate.h" | 7 #include "athena/extensions/public/extensions_delegate.h" |
8 #include "athena/main/public/athena_launcher.h" | 8 #include "athena/main/public/athena_launcher.h" |
9 #include "base/command_line.h" | |
9 #include "base/macros.h" | 10 #include "base/macros.h" |
10 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
11 #include "chrome/browser/chrome_browser_main_extra_parts.h" | 12 #include "chrome/browser/chrome_browser_main_extra_parts.h" |
12 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/profiles/profile_manager.h" | 14 #include "chrome/browser/profiles/profile_manager.h" |
15 #include "chromeos/chromeos_switches.h" | |
14 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
15 | 17 |
16 namespace { | 18 namespace { |
17 | 19 |
18 class ChromeBrowserMainExtraPartsAthena : public ChromeBrowserMainExtraParts { | 20 class ChromeBrowserMainExtraPartsAthena : public ChromeBrowserMainExtraParts { |
19 public: | 21 public: |
20 ChromeBrowserMainExtraPartsAthena() {} | 22 ChromeBrowserMainExtraPartsAthena() {} |
21 virtual ~ChromeBrowserMainExtraPartsAthena() {} | 23 virtual ~ChromeBrowserMainExtraPartsAthena() {} |
22 | 24 |
23 // Overridden from ChromeBrowserMainExtraParts: | 25 // Overridden from ChromeBrowserMainExtraParts: |
24 virtual void PreProfileInit() OVERRIDE { | 26 virtual void PreProfileInit() OVERRIDE { |
25 athena::StartAthenaEnv(content::BrowserThread::GetMessageLoopProxyForThread( | 27 athena::StartAthenaEnv(content::BrowserThread::GetMessageLoopProxyForThread( |
26 content::BrowserThread::FILE)); | 28 content::BrowserThread::FILE)); |
27 } | 29 } |
28 virtual void PostProfileInit() OVERRIDE { | 30 virtual void PostProfileInit() OVERRIDE { |
29 Profile* profile = | 31 Profile* profile = |
30 g_browser_process->profile_manager()->GetActiveUserProfile(); | 32 g_browser_process->profile_manager()->GetActiveUserProfile(); |
31 // TODO(oshima|polukhin): Start OOBE/Login process. | 33 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
Nikita (slow)
2014/09/08 09:53:17
This seems to cover https://code.google.com/p/chro
| |
32 athena::ExtensionsDelegate::CreateExtensionsDelegateForChrome(profile); | 34 chromeos::switches::kLoginManager)) { |
33 athena::StartAthenaSessionWithContext(profile); | 35 athena::ExtensionsDelegate::CreateExtensionsDelegateForChrome(profile); |
36 athena::StartAthenaSessionWithContext(profile); | |
37 } else { | |
38 // Only initialize virtual keyboard with login profile, user session will | |
39 // start after login. | |
40 athena::CreateVirtualKeyboardWithContext(profile); | |
41 } | |
34 } | 42 } |
35 virtual void PostMainMessageLoopRun() OVERRIDE { athena::ShutdownAthena(); } | 43 virtual void PostMainMessageLoopRun() OVERRIDE { athena::ShutdownAthena(); } |
36 | 44 |
37 private: | 45 private: |
38 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainExtraPartsAthena); | 46 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainExtraPartsAthena); |
39 }; | 47 }; |
40 | 48 |
41 } // namespace | 49 } // namespace |
42 | 50 |
43 ChromeBrowserMainExtraParts* CreateChromeBrowserMainExtraPartsAthena() { | 51 ChromeBrowserMainExtraParts* CreateChromeBrowserMainExtraPartsAthena() { |
44 return new ChromeBrowserMainExtraPartsAthena(); | 52 return new ChromeBrowserMainExtraPartsAthena(); |
45 } | 53 } |
OLD | NEW |