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

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

Issue 11364053: make StackingClient dispatch to either ash or desktop (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove file Created 8 years, 1 month 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/desktop/desktop_screen.h" 9 #include "ui/aura/desktop/desktop_screen.h"
10 #include "ui/aura/desktop/desktop_stacking_client.h" 10 #include "ui/aura/desktop/desktop_stacking_client.h"
11 #include "ui/aura/env.h" 11 #include "ui/aura/env.h"
12 #include "ui/aura/single_display_manager.h" 12 #include "ui/aura/single_display_manager.h"
13 #include "ui/gfx/screen.h" 13 #include "ui/gfx/screen.h"
14 #include "ui/views/widget/native_widget_aura.h" 14 #include "ui/views/widget/native_widget_aura.h"
15 15
16 #if defined(OS_LINUX) 16 #if defined(OS_LINUX)
17 #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h" 17 #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h"
18 #include "ui/base/linux_ui.h" 18 #include "ui/base/linux_ui.h"
19 #else
20 #include "chrome/browser/ui/aura/stacking_client_aurawin.h"
19 #endif 21 #endif
20 22
21 #if defined(USE_ASH) 23 #if defined(USE_ASH)
22 #include "chrome/browser/ui/ash/ash_init.h" 24 #include "chrome/browser/ui/ash/ash_init.h"
23 #endif 25 #endif
24 26
25 ChromeBrowserMainExtraPartsAura::ChromeBrowserMainExtraPartsAura() { 27 ChromeBrowserMainExtraPartsAura::ChromeBrowserMainExtraPartsAura() {
26 } 28 }
27 29
28 ChromeBrowserMainExtraPartsAura::~ChromeBrowserMainExtraPartsAura() { 30 ChromeBrowserMainExtraPartsAura::~ChromeBrowserMainExtraPartsAura() {
29 } 31 }
30 32
31 void ChromeBrowserMainExtraPartsAura::PreProfileInit() { 33 void ChromeBrowserMainExtraPartsAura::PreProfileInit() {
32 #if !defined(OS_CHROMEOS) 34 #if !defined(OS_CHROMEOS)
33 #if defined(USE_ASH) 35 #if defined(USE_ASH)
34 if (!chrome::ShouldOpenAshOnStartup()) 36 if (!chrome::ShouldOpenAshOnStartup())
35 #endif 37 #endif
36 { 38 {
37 gfx::Screen::SetScreenInstance( 39 gfx::Screen::SetScreenInstance(
38 gfx::SCREEN_TYPE_NATIVE, aura::CreateDesktopScreen()); 40 gfx::SCREEN_TYPE_NATIVE, aura::CreateDesktopScreen());
39 aura::Env::GetInstance()->SetDisplayManager(new aura::SingleDisplayManager); 41 aura::Env::GetInstance()->SetDisplayManager(new aura::SingleDisplayManager);
42 #if defined(OS_LINUX)
40 stacking_client_.reset(new aura::DesktopStackingClient); 43 stacking_client_.reset(new aura::DesktopStackingClient);
44 #else
45 stacking_client_.reset(new StackingClientAuraWin);
Ben Goodger (Google) 2012/11/12 16:49:33 is there any reason we can't use this on windows t
scottmg 2012/11/12 18:03:53 Done. ("can't use this on linux too?" i assume)
46 #endif
47 aura::client::SetStackingClient(stacking_client_.get());
41 } 48 }
42 #endif 49 #endif
43 50
44 #if !defined(USE_ASH) && defined(OS_LINUX) 51 #if !defined(USE_ASH) && defined(OS_LINUX)
45 // TODO(erg): Refactor this into a dlopen call when we add a GTK3 port. 52 // TODO(erg): Refactor this into a dlopen call when we add a GTK3 port.
46 ui::LinuxUI::SetInstance(BuildGtk2UI()); 53 ui::LinuxUI::SetInstance(BuildGtk2UI());
47 #endif 54 #endif
48 } 55 }
49 56
50 void ChromeBrowserMainExtraPartsAura::PostMainMessageLoopRun() { 57 void ChromeBrowserMainExtraPartsAura::PostMainMessageLoopRun() {
51 stacking_client_.reset(); 58 stacking_client_.reset();
52 59
53 // aura::Env instance is deleted in BrowserProcessImpl::StartTearDown 60 // aura::Env instance is deleted in BrowserProcessImpl::StartTearDown
54 // after the metrics service is deleted. 61 // after the metrics service is deleted.
55 } 62 }
56 63
57 namespace chrome { 64 namespace chrome {
58 65
59 void AddAuraToolkitExtraParts(ChromeBrowserMainParts* main_parts) { 66 void AddAuraToolkitExtraParts(ChromeBrowserMainParts* main_parts) {
60 main_parts->AddParts(new ChromeBrowserMainExtraPartsAura()); 67 main_parts->AddParts(new ChromeBrowserMainExtraPartsAura());
61 } 68 }
62 69
63 } // namespace chrome 70 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698