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

Side by Side Diff: chrome/browser/ui/aura/chrome_browser_main_extra_parts_aura.cc

Issue 10545037: Aura/GTK integration: Create a small stub library that can talk to GTK. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sky nits Created 8 years, 6 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 | Annotate | Revision Log
OLDNEW
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/aura/chrome_browser_main_extra_parts_aura.h" 5 #include "chrome/browser/ui/aura/chrome_browser_main_extra_parts_aura.h"
6 6
7 #include "chrome/browser/chrome_browser_main.h" 7 #include "chrome/browser/chrome_browser_main.h"
8 #include "chrome/browser/toolkit_extra_parts.h" 8 #include "chrome/browser/toolkit_extra_parts.h"
9 #include "ui/aura/env.h" 9 #include "ui/aura/env.h"
10 10
11 #if !defined(USE_ASH) 11 #if !defined(USE_ASH)
12 #include "ui/aura/desktop/desktop_screen.h" 12 #include "ui/aura/desktop/desktop_screen.h"
13 #include "ui/aura/desktop/desktop_stacking_client.h" 13 #include "ui/aura/desktop/desktop_stacking_client.h"
14 #include "ui/aura/env.h" 14 #include "ui/aura/env.h"
15 #include "ui/aura/single_monitor_manager.h" 15 #include "ui/aura/single_monitor_manager.h"
16 #include "ui/gfx/screen.h" 16 #include "ui/gfx/screen.h"
17 #include "ui/views/widget/native_widget_aura.h" 17 #include "ui/views/widget/native_widget_aura.h"
18 #if defined(OS_LINUX)
19 #include "ui/base/linux_ui.h"
20 #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h"
21 #endif
18 #endif // !USE_ASH 22 #endif // !USE_ASH
19 23
20 ChromeBrowserMainExtraPartsAura::ChromeBrowserMainExtraPartsAura() { 24 ChromeBrowserMainExtraPartsAura::ChromeBrowserMainExtraPartsAura() {
21 } 25 }
22 26
23 void ChromeBrowserMainExtraPartsAura::PreProfileInit() { 27 void ChromeBrowserMainExtraPartsAura::PreProfileInit() {
24 #if !defined(USE_ASH) 28 #if !defined(USE_ASH)
25 gfx::Screen::SetInstance(aura::CreateDesktopScreen()); 29 gfx::Screen::SetInstance(aura::CreateDesktopScreen());
26 aura::Env::GetInstance()->SetMonitorManager(new aura::SingleMonitorManager); 30 aura::Env::GetInstance()->SetMonitorManager(new aura::SingleMonitorManager);
27 stacking_client_.reset(new aura::DesktopStackingClient); 31 stacking_client_.reset(new aura::DesktopStackingClient);
28 #endif // !USE_ASH 32 #endif // !USE_ASH
33
34 #if !defined(USE_ASH) && defined(OS_LINUX)
35 // TODO(erg): Refactor this into a dlopen call when we add a GTK3 port.
36 ui::LinuxUI::SetInstance(BuildGtk2UI());
37 #endif
29 } 38 }
30 39
31 void ChromeBrowserMainExtraPartsAura::PostMainMessageLoopRun() { 40 void ChromeBrowserMainExtraPartsAura::PostMainMessageLoopRun() {
32 #if !defined(USE_ASH) 41 #if !defined(USE_ASH)
33 stacking_client_.reset(); 42 stacking_client_.reset();
34 #endif 43 #endif
35 44
36 // aura::Env instance is deleted in BrowserProcessImpl::StartTearDown 45 // aura::Env instance is deleted in BrowserProcessImpl::StartTearDown
37 // after the metrics service is deleted. 46 // after the metrics service is deleted.
38 } 47 }
39 48
40 namespace browser { 49 namespace browser {
41 50
42 void AddAuraToolkitExtraParts(ChromeBrowserMainParts* main_parts) { 51 void AddAuraToolkitExtraParts(ChromeBrowserMainParts* main_parts) {
43 main_parts->AddParts(new ChromeBrowserMainExtraPartsAura()); 52 main_parts->AddParts(new ChromeBrowserMainExtraPartsAura());
44 } 53 }
45 54
46 } // namespace browser 55 } // namespace browser
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698