OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/chrome_browser_main_extra_parts_views_linux.h" | 5 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h" |
6 | 6 |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "chrome/browser/chrome_browser_main.h" | 8 #include "chrome/browser/chrome_browser_main.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/themes/theme_service.h" | 10 #include "chrome/browser/themes/theme_service.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 ChromeBrowserMainExtraPartsViewsLinux::ChromeBrowserMainExtraPartsViewsLinux() { | 64 ChromeBrowserMainExtraPartsViewsLinux::ChromeBrowserMainExtraPartsViewsLinux() { |
65 } | 65 } |
66 | 66 |
67 ChromeBrowserMainExtraPartsViewsLinux:: | 67 ChromeBrowserMainExtraPartsViewsLinux:: |
68 ~ChromeBrowserMainExtraPartsViewsLinux() { | 68 ~ChromeBrowserMainExtraPartsViewsLinux() { |
69 views::X11DesktopHandler::get()->RemoveObserver(this); | 69 views::X11DesktopHandler::get()->RemoveObserver(this); |
70 } | 70 } |
71 | 71 |
72 void ChromeBrowserMainExtraPartsViewsLinux::PreEarlyInitialization() { | 72 void ChromeBrowserMainExtraPartsViewsLinux::PreEarlyInitialization() { |
73 // TODO(erg): Refactor this into a dlopen call when we add a GTK3 port. | 73 // TODO(erg): Refactor this into a dlopen call when we add a GTK3 port. |
74 views::LinuxUI* gtk2_ui = BuildGtk2UI(); | 74 views::LinuxUI* gtk2_ui = BuildGtkUi(); |
75 gtk2_ui->SetNativeThemeOverride(base::Bind(&GetNativeThemeForWindow)); | 75 gtk2_ui->SetNativeThemeOverride(base::Bind(&GetNativeThemeForWindow)); |
76 views::LinuxUI::SetInstance(gtk2_ui); | 76 views::LinuxUI::SetInstance(gtk2_ui); |
77 } | 77 } |
78 | 78 |
79 void ChromeBrowserMainExtraPartsViewsLinux::ToolkitInitialized() { | 79 void ChromeBrowserMainExtraPartsViewsLinux::ToolkitInitialized() { |
80 ChromeBrowserMainExtraPartsViews::ToolkitInitialized(); | 80 ChromeBrowserMainExtraPartsViews::ToolkitInitialized(); |
81 views::LinuxUI::instance()->Initialize(); | 81 views::LinuxUI::instance()->Initialize(); |
82 } | 82 } |
83 | 83 |
84 void ChromeBrowserMainExtraPartsViewsLinux::PreCreateThreads() { | 84 void ChromeBrowserMainExtraPartsViewsLinux::PreCreateThreads() { |
85 // Update the device scale factor before initializing views | 85 // Update the device scale factor before initializing views |
86 // because its display::Screen instance depends on it. | 86 // because its display::Screen instance depends on it. |
87 views::LinuxUI::instance()->UpdateDeviceScaleFactor(); | 87 views::LinuxUI::instance()->UpdateDeviceScaleFactor(); |
88 ChromeBrowserMainExtraPartsViews::PreCreateThreads(); | 88 ChromeBrowserMainExtraPartsViews::PreCreateThreads(); |
89 views::X11DesktopHandler::get()->AddObserver(this); | 89 views::X11DesktopHandler::get()->AddObserver(this); |
90 } | 90 } |
91 | 91 |
92 void ChromeBrowserMainExtraPartsViewsLinux::OnWorkspaceChanged( | 92 void ChromeBrowserMainExtraPartsViewsLinux::OnWorkspaceChanged( |
93 const std::string& new_workspace) { | 93 const std::string& new_workspace) { |
94 BrowserList::MoveBrowsersInWorkspaceToFront(new_workspace); | 94 BrowserList::MoveBrowsersInWorkspaceToFront(new_workspace); |
95 } | 95 } |
OLD | NEW |