OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/views/athena/chrome_browser_main_extra_parts_athena.
h" |
| 6 |
| 7 #include "athena/extensions/public/extensions_delegate.h" |
| 8 #include "athena/main/athena_launcher.h" |
| 9 #include "base/macros.h" |
| 10 #include "chrome/browser/browser_process.h" |
| 11 #include "chrome/browser/chrome_browser_main_extra_parts.h" |
| 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/profiles/profile_manager.h" |
| 14 #include "content/public/browser/browser_thread.h" |
| 15 |
| 16 namespace { |
| 17 |
| 18 class ChromeBrowserMainExtraPartsAthena : public ChromeBrowserMainExtraParts { |
| 19 public: |
| 20 ChromeBrowserMainExtraPartsAthena() {} |
| 21 virtual ~ChromeBrowserMainExtraPartsAthena() {} |
| 22 |
| 23 // Overridden from ChromeBrowserMainExtraParts: |
| 24 virtual void PreProfileInit() OVERRIDE { |
| 25 athena::StartAthenaEnv(content::BrowserThread::GetMessageLoopProxyForThread( |
| 26 content::BrowserThread::FILE)); |
| 27 } |
| 28 virtual void PostProfileInit() OVERRIDE { |
| 29 Profile* profile = |
| 30 g_browser_process->profile_manager()->GetActiveUserProfile(); |
| 31 // TODO(oshima|polukhin): Start OOBE/Login process. |
| 32 athena::ExtensionsDelegate::CreateExtensionsDelegateForChrome(profile); |
| 33 athena::StartAthenaSessionWithContext(profile); |
| 34 } |
| 35 virtual void PostMainMessageLoopRun() OVERRIDE { athena::ShutdownAthena(); } |
| 36 |
| 37 private: |
| 38 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainExtraPartsAthena); |
| 39 }; |
| 40 |
| 41 } // namespace |
| 42 |
| 43 ChromeBrowserMainExtraParts* CreateChromeBrowserMainExtraPartsAthena() { |
| 44 return new ChromeBrowserMainExtraPartsAthena(); |
| 45 } |
OLD | NEW |