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

Side by Side Diff: chrome/browser/ui/views/frame/browser_frame_mus.cc

Issue 2823903005: Extracts parameters to WindowTreeHostMus into structure (Closed)
Patch Set: move constructor Created 3 years, 8 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
« no previous file with comments | « ash/mus/window_manager_unittest.cc ('k') | services/ui/ws/window_manager_client_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/frame/browser_frame_mus.h" 5 #include "chrome/browser/ui/views/frame/browser_frame_mus.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "chrome/browser/ui/views/frame/browser_frame.h" 10 #include "chrome/browser/ui/views/frame/browser_frame.h"
11 #include "chrome/browser/ui/views/frame/browser_view.h" 11 #include "chrome/browser/ui/views/frame/browser_view.h"
12 #include "chrome/common/extensions/extension_constants.h" 12 #include "chrome/common/extensions/extension_constants.h"
13 #include "services/ui/public/cpp/property_type_converters.h" 13 #include "services/ui/public/cpp/property_type_converters.h"
14 #include "services/ui/public/interfaces/window_tree.mojom.h" 14 #include "services/ui/public/interfaces/window_tree.mojom.h"
15 #include "ui/aura/mus/window_tree_host_mus_init_params.h"
15 #include "ui/views/mus/desktop_window_tree_host_mus.h" 16 #include "ui/views/mus/desktop_window_tree_host_mus.h"
16 #include "ui/views/mus/mus_client.h" 17 #include "ui/views/mus/mus_client.h"
17 #include "ui/views/mus/window_manager_frame_values.h" 18 #include "ui/views/mus/window_manager_frame_values.h"
18 19
19 #if defined(OS_CHROMEOS) 20 #if defined(OS_CHROMEOS)
20 #include "ash/public/interfaces/window_style.mojom.h" 21 #include "ash/public/interfaces/window_style.mojom.h"
21 #endif 22 #endif
22 23
23 BrowserFrameMus::BrowserFrameMus(BrowserFrame* browser_frame, 24 BrowserFrameMus::BrowserFrameMus(BrowserFrame* browser_frame,
24 BrowserView* browser_view) 25 BrowserView* browser_view)
(...skipping 15 matching lines...) Expand all
40 // Indicates mash shouldn't handle immersive, rather we will. 41 // Indicates mash shouldn't handle immersive, rather we will.
41 properties[ui::mojom::WindowManager::kDisableImmersive_InitProperty] = 42 properties[ui::mojom::WindowManager::kDisableImmersive_InitProperty] =
42 mojo::ConvertTo<std::vector<uint8_t>>(true); 43 mojo::ConvertTo<std::vector<uint8_t>>(true);
43 properties[ui::mojom::WindowManager::kAppID_Property] = 44 properties[ui::mojom::WindowManager::kAppID_Property] =
44 mojo::ConvertTo<std::vector<uint8_t>>(chrome_app_id); 45 mojo::ConvertTo<std::vector<uint8_t>>(chrome_app_id);
45 #if defined(OS_CHROMEOS) 46 #if defined(OS_CHROMEOS)
46 properties[ash::mojom::kAshWindowStyle_InitProperty] = 47 properties[ash::mojom::kAshWindowStyle_InitProperty] =
47 mojo::ConvertTo<std::vector<uint8_t>>( 48 mojo::ConvertTo<std::vector<uint8_t>>(
48 static_cast<int32_t>(ash::mojom::WindowStyle::BROWSER)); 49 static_cast<int32_t>(ash::mojom::WindowStyle::BROWSER));
49 #endif 50 #endif
51 aura::WindowTreeHostMusInitParams window_tree_host_init_params =
52 aura::CreateInitParamsForTopLevel(
53 views::MusClient::Get()->window_tree_client(), std::move(properties));
50 std::unique_ptr<views::DesktopWindowTreeHostMus> desktop_window_tree_host = 54 std::unique_ptr<views::DesktopWindowTreeHostMus> desktop_window_tree_host =
51 base::MakeUnique<views::DesktopWindowTreeHostMus>( 55 base::MakeUnique<views::DesktopWindowTreeHostMus>(
52 browser_frame_, this, cc::FrameSinkId(), &properties); 56 std::move(window_tree_host_init_params), browser_frame_, this);
53 // BrowserNonClientFrameViewMus::OnBoundsChanged() takes care of updating 57 // BrowserNonClientFrameViewMus::OnBoundsChanged() takes care of updating
54 // the insets. 58 // the insets.
55 desktop_window_tree_host->set_auto_update_client_area(false); 59 desktop_window_tree_host->set_auto_update_client_area(false);
56 SetDesktopWindowTreeHost(std::move(desktop_window_tree_host)); 60 SetDesktopWindowTreeHost(std::move(desktop_window_tree_host));
57 return params; 61 return params;
58 } 62 }
59 63
60 bool BrowserFrameMus::UseCustomFrame() const { 64 bool BrowserFrameMus::UseCustomFrame() const {
61 return true; 65 return true;
62 } 66 }
(...skipping 18 matching lines...) Expand all
81 } 85 }
82 86
83 bool BrowserFrameMus::HandleKeyboardEvent( 87 bool BrowserFrameMus::HandleKeyboardEvent(
84 const content::NativeWebKeyboardEvent& event) { 88 const content::NativeWebKeyboardEvent& event) {
85 return false; 89 return false;
86 } 90 }
87 91
88 int BrowserFrameMus::GetMinimizeButtonOffset() const { 92 int BrowserFrameMus::GetMinimizeButtonOffset() const {
89 return 0; 93 return 0;
90 } 94 }
OLDNEW
« no previous file with comments | « ash/mus/window_manager_unittest.cc ('k') | services/ui/ws/window_manager_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698