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

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

Issue 2724693002: mash: improves browser frame decorations (Closed)
Patch Set: merge Created 3 years, 9 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
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/views/mus/desktop_window_tree_host_mus.h" 15 #include "ui/views/mus/desktop_window_tree_host_mus.h"
16 #include "ui/views/mus/mus_client.h" 16 #include "ui/views/mus/mus_client.h"
17 #include "ui/views/mus/window_manager_frame_values.h" 17 #include "ui/views/mus/window_manager_frame_values.h"
18 18
19 #if defined(OS_CHROMEOS)
20 #include "ash/public/interfaces/window_style.mojom.h"
21 #endif
22
19 BrowserFrameMus::BrowserFrameMus(BrowserFrame* browser_frame, 23 BrowserFrameMus::BrowserFrameMus(BrowserFrame* browser_frame,
20 BrowserView* browser_view) 24 BrowserView* browser_view)
21 : views::DesktopNativeWidgetAura(browser_frame), 25 : views::DesktopNativeWidgetAura(browser_frame),
22 browser_frame_(browser_frame), 26 browser_frame_(browser_frame),
23 browser_view_(browser_view) {} 27 browser_view_(browser_view) {}
24 28
25 BrowserFrameMus::~BrowserFrameMus() {} 29 BrowserFrameMus::~BrowserFrameMus() {}
26 30
27 views::Widget::InitParams BrowserFrameMus::GetWidgetParams() { 31 views::Widget::InitParams BrowserFrameMus::GetWidgetParams() {
28 views::Widget::InitParams params; 32 views::Widget::InitParams params;
33 params.name = "BrowserFrame";
29 params.native_widget = this; 34 params.native_widget = this;
30 params.bounds = gfx::Rect(10, 10, 640, 480); 35 params.bounds = gfx::Rect(10, 10, 640, 480);
31 params.delegate = browser_view_; 36 params.delegate = browser_view_;
32 std::map<std::string, std::vector<uint8_t>> properties = 37 std::map<std::string, std::vector<uint8_t>> properties =
33 views::MusClient::ConfigurePropertiesFromParams(params); 38 views::MusClient::ConfigurePropertiesFromParams(params);
34 const std::string chrome_app_id(extension_misc::kChromeAppId); 39 const std::string chrome_app_id(extension_misc::kChromeAppId);
35 // Indicates mash shouldn't handle immersive, rather we will. 40 // Indicates mash shouldn't handle immersive, rather we will.
36 properties[ui::mojom::WindowManager::kDisableImmersive_InitProperty] = 41 properties[ui::mojom::WindowManager::kDisableImmersive_InitProperty] =
37 mojo::ConvertTo<std::vector<uint8_t>>(true); 42 mojo::ConvertTo<std::vector<uint8_t>>(true);
38 properties[ui::mojom::WindowManager::kAppID_Property] = 43 properties[ui::mojom::WindowManager::kAppID_Property] =
39 mojo::ConvertTo<std::vector<uint8_t>>(chrome_app_id); 44 mojo::ConvertTo<std::vector<uint8_t>>(chrome_app_id);
45 #if defined(OS_CHROMEOS)
46 properties[ash::mojom::kAshWindowStyle_InitProperty] =
47 mojo::ConvertTo<std::vector<uint8_t>>(
48 static_cast<int32_t>(ash::mojom::WindowStyle::BROWSER));
49 #endif
40 std::unique_ptr<views::DesktopWindowTreeHostMus> desktop_window_tree_host = 50 std::unique_ptr<views::DesktopWindowTreeHostMus> desktop_window_tree_host =
41 base::MakeUnique<views::DesktopWindowTreeHostMus>(browser_frame_, this, 51 base::MakeUnique<views::DesktopWindowTreeHostMus>(browser_frame_, this,
42 &properties); 52 &properties);
43 // BrowserNonClientFrameViewMus::OnBoundsChanged() takes care of updating 53 // BrowserNonClientFrameViewMus::OnBoundsChanged() takes care of updating
44 // the insets. 54 // the insets.
45 desktop_window_tree_host->set_auto_update_client_area(false); 55 desktop_window_tree_host->set_auto_update_client_area(false);
46 SetDesktopWindowTreeHost(std::move(desktop_window_tree_host)); 56 SetDesktopWindowTreeHost(std::move(desktop_window_tree_host));
47 return params; 57 return params;
48 } 58 }
49 59
(...skipping 21 matching lines...) Expand all
71 } 81 }
72 82
73 bool BrowserFrameMus::HandleKeyboardEvent( 83 bool BrowserFrameMus::HandleKeyboardEvent(
74 const content::NativeWebKeyboardEvent& event) { 84 const content::NativeWebKeyboardEvent& event) {
75 return false; 85 return false;
76 } 86 }
77 87
78 int BrowserFrameMus::GetMinimizeButtonOffset() const { 88 int BrowserFrameMus::GetMinimizeButtonOffset() const {
79 return 0; 89 return 0;
80 } 90 }
OLDNEW
« no previous file with comments | « ash/public/interfaces/window_style.mojom ('k') | chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698