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/chrome_browser_main.h" | 5 #include "chrome/browser/chrome_browser_main.h" |
6 | 6 |
7 #if defined(TOOLKIT_GTK) | 7 #if defined(TOOLKIT_GTK) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 #endif | 187 #endif |
188 | 188 |
189 #if defined(ENABLE_RLZ) | 189 #if defined(ENABLE_RLZ) |
190 #include "chrome/browser/rlz/rlz.h" | 190 #include "chrome/browser/rlz/rlz.h" |
191 #endif | 191 #endif |
192 | 192 |
193 #if defined(TOOLKIT_VIEWS) | 193 #if defined(TOOLKIT_VIEWS) |
194 #include "ui/views/focus/accelerator_handler.h" | 194 #include "ui/views/focus/accelerator_handler.h" |
195 #endif | 195 #endif |
196 | 196 |
| 197 #if defined(USE_AURA) |
| 198 #include "ui/aura/env.h" |
| 199 #endif |
| 200 |
197 using content::BrowserThread; | 201 using content::BrowserThread; |
198 | 202 |
199 namespace { | 203 namespace { |
200 | 204 |
201 // This function provides some ways to test crash and assertion handling | 205 // This function provides some ways to test crash and assertion handling |
202 // behavior of the program. | 206 // behavior of the program. |
203 void HandleTestParameters(const CommandLine& command_line) { | 207 void HandleTestParameters(const CommandLine& command_line) { |
204 // This parameter causes an assertion. | 208 // This parameter causes an assertion. |
205 if (command_line.HasSwitch(switches::kBrowserAssertTest)) { | 209 if (command_line.HasSwitch(switches::kBrowserAssertTest)) { |
206 DCHECK(false); | 210 DCHECK(false); |
(...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1459 // only once we log in. | 1463 // only once we log in. |
1460 std::vector<Profile*> last_opened_profiles; | 1464 std::vector<Profile*> last_opened_profiles; |
1461 #else | 1465 #else |
1462 std::vector<Profile*> last_opened_profiles = | 1466 std::vector<Profile*> last_opened_profiles = |
1463 g_browser_process->profile_manager()->GetLastOpenedProfiles(); | 1467 g_browser_process->profile_manager()->GetLastOpenedProfiles(); |
1464 #endif | 1468 #endif |
1465 | 1469 |
1466 if (!parsed_command_line().HasSwitch(switches::kDisableComponentUpdate)) | 1470 if (!parsed_command_line().HasSwitch(switches::kDisableComponentUpdate)) |
1467 RegisterComponentsForUpdate(parsed_command_line()); | 1471 RegisterComponentsForUpdate(parsed_command_line()); |
1468 | 1472 |
| 1473 #if defined(USE_AURA) |
| 1474 // Env creates the compositor. Aura widgets need the compositor to be created |
| 1475 // before they can be initialized by the browser. |
| 1476 aura::Env::CreateInstance(); |
| 1477 #endif |
| 1478 |
1469 if (browser_creator_->Start(parsed_command_line(), base::FilePath(), | 1479 if (browser_creator_->Start(parsed_command_line(), base::FilePath(), |
1470 profile_, last_opened_profiles, &result_code)) { | 1480 profile_, last_opened_profiles, &result_code)) { |
1471 #if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) | 1481 #if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) |
1472 // Initialize autoupdate timer. Timer callback costs basically nothing | 1482 // Initialize autoupdate timer. Timer callback costs basically nothing |
1473 // when browser is not in persistent mode, so it's OK to let it ride on | 1483 // when browser is not in persistent mode, so it's OK to let it ride on |
1474 // the main thread. This needs to be done here because we don't want | 1484 // the main thread. This needs to be done here because we don't want |
1475 // to start the timer when Chrome is run inside a test harness. | 1485 // to start the timer when Chrome is run inside a test harness. |
1476 browser_process_->StartAutoupdateTimer(); | 1486 browser_process_->StartAutoupdateTimer(); |
1477 #endif | 1487 #endif |
1478 | 1488 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1645 chromeos::CrosSettings::Shutdown(); | 1655 chromeos::CrosSettings::Shutdown(); |
1646 #endif | 1656 #endif |
1647 #endif | 1657 #endif |
1648 } | 1658 } |
1649 | 1659 |
1650 // Public members: | 1660 // Public members: |
1651 | 1661 |
1652 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1662 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
1653 chrome_extra_parts_.push_back(parts); | 1663 chrome_extra_parts_.push_back(parts); |
1654 } | 1664 } |
OLD | NEW |