OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ash/chrome_browser_main_extra_parts_ash.h" | 5 #include "chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "chrome/browser/chrome_browser_main.h" | 9 #include "chrome/browser/chrome_browser_main.h" |
10 #include "chrome/browser/toolkit_extra_parts.h" | 10 #include "chrome/browser/toolkit_extra_parts.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 #endif | 56 #endif |
57 | 57 |
58 ChromeBrowserMainExtraPartsAsh::ChromeBrowserMainExtraPartsAsh() { | 58 ChromeBrowserMainExtraPartsAsh::ChromeBrowserMainExtraPartsAsh() { |
59 } | 59 } |
60 | 60 |
61 ChromeBrowserMainExtraPartsAsh::~ChromeBrowserMainExtraPartsAsh() { | 61 ChromeBrowserMainExtraPartsAsh::~ChromeBrowserMainExtraPartsAsh() { |
62 } | 62 } |
63 | 63 |
64 void ChromeBrowserMainExtraPartsAsh::PreProfileInit() { | 64 void ChromeBrowserMainExtraPartsAsh::PreProfileInit() { |
| 65 } |
| 66 |
| 67 void ChromeBrowserMainExtraPartsAsh::PostProfileInit() { |
65 if (chrome::ShouldOpenAshOnStartup()) { | 68 if (chrome::ShouldOpenAshOnStartup()) { |
66 chrome::OpenAsh(); | 69 chrome::OpenAsh(); |
67 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 70 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
68 switches::kAshDisableTabScrubbing)) { | 71 switches::kAshDisableTabScrubbing)) { |
69 TabScrubber::GetInstance(); | 72 TabScrubber::GetInstance(); |
70 } | 73 } |
71 } else { | 74 } else { |
72 #if !defined(OS_CHROMEOS) | 75 #if !defined(OS_CHROMEOS) |
73 gfx::Screen::SetScreenTypeDelegate(new ScreenTypeDelegateWin); | 76 gfx::Screen::SetScreenTypeDelegate(new ScreenTypeDelegateWin); |
74 ui::SelectFileDialog::SetShellDialogsDelegate( | 77 ui::SelectFileDialog::SetShellDialogsDelegate( |
75 &g_shell_dialogs_delegate.Get()); | 78 &g_shell_dialogs_delegate.Get()); |
76 #endif | 79 #endif |
77 } | 80 } |
78 | 81 |
79 #if defined(FILE_MANAGER_EXTENSION) | 82 #if defined(FILE_MANAGER_EXTENSION) |
80 ui::SelectFileDialog::SetFactory(new SelectFileDialogExtensionFactory); | 83 ui::SelectFileDialog::SetFactory(new SelectFileDialogExtensionFactory); |
81 #endif | 84 #endif |
82 } | 85 } |
83 | 86 |
84 void ChromeBrowserMainExtraPartsAsh::PostProfileInit() { | |
85 } | |
86 | |
87 void ChromeBrowserMainExtraPartsAsh::PostMainMessageLoopRun() { | 87 void ChromeBrowserMainExtraPartsAsh::PostMainMessageLoopRun() { |
88 chrome::CloseAsh(); | 88 chrome::CloseAsh(); |
89 } | 89 } |
90 | 90 |
91 namespace chrome { | 91 namespace chrome { |
92 | 92 |
93 void AddAshToolkitExtraParts(ChromeBrowserMainParts* main_parts) { | 93 void AddAshToolkitExtraParts(ChromeBrowserMainParts* main_parts) { |
94 main_parts->AddParts(new ChromeBrowserMainExtraPartsAsh()); | 94 main_parts->AddParts(new ChromeBrowserMainExtraPartsAsh()); |
95 } | 95 } |
96 | 96 |
97 } // namespace chrome | 97 } // namespace chrome |
OLD | NEW |