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/chrome_browser_main_extra_parts_views.h" | 5 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h" | 8 #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h" |
9 #include "chrome/browser/ui/views/chrome_views_delegate.h" | 9 #include "chrome/browser/ui/views/chrome_views_delegate.h" |
| 10 #include "chrome/browser/ui/views/harmony/layout_delegate.h" |
10 #include "chrome/browser/ui/views/ime_driver/ime_driver_mus.h" | 11 #include "chrome/browser/ui/views/ime_driver/ime_driver_mus.h" |
11 #include "components/constrained_window/constrained_window_views.h" | 12 #include "components/constrained_window/constrained_window_views.h" |
12 | 13 |
13 #if defined(USE_AURA) | 14 #if defined(USE_AURA) |
14 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
15 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
16 #include "content/public/common/service_manager_connection.h" | 17 #include "content/public/common/service_manager_connection.h" |
17 #include "services/service_manager/public/cpp/connector.h" | 18 #include "services/service_manager/public/cpp/connector.h" |
18 #include "services/service_manager/runner/common/client_util.h" | 19 #include "services/service_manager/runner/common/client_util.h" |
19 #include "services/ui/public/cpp/gpu/gpu.h" // nogncheck | 20 #include "services/ui/public/cpp/gpu/gpu.h" // nogncheck |
(...skipping 21 matching lines...) Expand all Loading... |
41 ChromeBrowserMainExtraPartsViews::~ChromeBrowserMainExtraPartsViews() { | 42 ChromeBrowserMainExtraPartsViews::~ChromeBrowserMainExtraPartsViews() { |
42 constrained_window::SetConstrainedWindowViewsClient(nullptr); | 43 constrained_window::SetConstrainedWindowViewsClient(nullptr); |
43 } | 44 } |
44 | 45 |
45 void ChromeBrowserMainExtraPartsViews::ToolkitInitialized() { | 46 void ChromeBrowserMainExtraPartsViews::ToolkitInitialized() { |
46 // The delegate needs to be set before any UI is created so that windows | 47 // The delegate needs to be set before any UI is created so that windows |
47 // display the correct icon. | 48 // display the correct icon. |
48 if (!views::ViewsDelegate::GetInstance()) | 49 if (!views::ViewsDelegate::GetInstance()) |
49 views_delegate_.reset(new ChromeViewsDelegate); | 50 views_delegate_.reset(new ChromeViewsDelegate); |
50 | 51 |
| 52 // Ensure layout and typography is correctly configured based on flags. |
| 53 LayoutDelegate::Get(); |
| 54 |
51 SetConstrainedWindowViewsClient(CreateChromeConstrainedWindowViewsClient()); | 55 SetConstrainedWindowViewsClient(CreateChromeConstrainedWindowViewsClient()); |
52 | 56 |
53 #if defined(USE_AURA) | 57 #if defined(USE_AURA) |
54 wm_state_.reset(new wm::WMState); | 58 wm_state_.reset(new wm::WMState); |
55 #endif | 59 #endif |
56 } | 60 } |
57 | 61 |
58 void ChromeBrowserMainExtraPartsViews::PreCreateThreads() { | 62 void ChromeBrowserMainExtraPartsViews::PreCreateThreads() { |
59 #if defined(USE_AURA) && !defined(OS_CHROMEOS) && !defined(USE_OZONE) | 63 #if defined(USE_AURA) && !defined(OS_CHROMEOS) && !defined(USE_OZONE) |
60 // The screen may have already been set in test initialization. | 64 // The screen may have already been set in test initialization. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 // WMState is owned as a member, so don't have MusClient create it. | 114 // WMState is owned as a member, so don't have MusClient create it. |
111 const bool create_wm_state = false; | 115 const bool create_wm_state = false; |
112 mus_client_ = base::MakeUnique<views::MusClient>( | 116 mus_client_ = base::MakeUnique<views::MusClient>( |
113 connection->GetConnector(), service_manager::Identity(), | 117 connection->GetConnector(), service_manager::Identity(), |
114 content::BrowserThread::GetTaskRunnerForThread( | 118 content::BrowserThread::GetTaskRunnerForThread( |
115 content::BrowserThread::IO), | 119 content::BrowserThread::IO), |
116 create_wm_state); | 120 create_wm_state); |
117 } | 121 } |
118 #endif // defined(USE_AURA) | 122 #endif // defined(USE_AURA) |
119 } | 123 } |
OLD | NEW |