| 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/chrome_views_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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 } | 58 } |
| 58 | 59 |
| 59 ChromeBrowserMainExtraPartsViews::~ChromeBrowserMainExtraPartsViews() { | 60 ChromeBrowserMainExtraPartsViews::~ChromeBrowserMainExtraPartsViews() { |
| 60 constrained_window::SetConstrainedWindowViewsClient(nullptr); | 61 constrained_window::SetConstrainedWindowViewsClient(nullptr); |
| 61 } | 62 } |
| 62 | 63 |
| 63 void ChromeBrowserMainExtraPartsViews::ToolkitInitialized() { | 64 void ChromeBrowserMainExtraPartsViews::ToolkitInitialized() { |
| 64 // The delegate needs to be set before any UI is created so that windows | 65 // The delegate needs to be set before any UI is created so that windows |
| 65 // display the correct icon. | 66 // display the correct icon. |
| 66 if (!views::ViewsDelegate::GetInstance()) | 67 if (!views::ViewsDelegate::GetInstance()) |
| 67 views_delegate_.reset(new ChromeViewsDelegate); | 68 views_delegate_.reset(new ChromeViewsDelegate()); |
| 69 |
| 70 if (!views::ViewsLayoutDelegate::Get()) |
| 71 layout_delegate_ = ChromeViewsLayoutDelegate::CreateLayoutDelegate(); |
| 68 | 72 |
| 69 SetConstrainedWindowViewsClient(CreateChromeConstrainedWindowViewsClient()); | 73 SetConstrainedWindowViewsClient(CreateChromeConstrainedWindowViewsClient()); |
| 70 | 74 |
| 71 #if defined(USE_AURA) | 75 #if defined(USE_AURA) |
| 72 if (ShouldCreateWMState()) | 76 if (ShouldCreateWMState()) |
| 73 wm_state_.reset(new wm::WMState); | 77 wm_state_.reset(new wm::WMState); |
| 74 #endif | 78 #endif |
| 75 } | 79 } |
| 76 | 80 |
| 77 void ChromeBrowserMainExtraPartsViews::PreCreateThreads() { | 81 void ChromeBrowserMainExtraPartsViews::PreCreateThreads() { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 139 |
| 136 // WMState is owned as a member, so don't have MusClient create it. | 140 // WMState is owned as a member, so don't have MusClient create it. |
| 137 const bool create_wm_state = false; | 141 const bool create_wm_state = false; |
| 138 mus_client_ = base::MakeUnique<views::MusClient>( | 142 mus_client_ = base::MakeUnique<views::MusClient>( |
| 139 connection->GetConnector(), service_manager::Identity(), | 143 connection->GetConnector(), service_manager::Identity(), |
| 140 content::BrowserThread::GetTaskRunnerForThread( | 144 content::BrowserThread::GetTaskRunnerForThread( |
| 141 content::BrowserThread::IO), | 145 content::BrowserThread::IO), |
| 142 create_wm_state); | 146 create_wm_state); |
| 143 #endif // defined(USE_AURA) | 147 #endif // defined(USE_AURA) |
| 144 } | 148 } |
| OLD | NEW |