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

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

Issue 2577963006: Revert of Converts chrome to aura-mus (Closed)
Patch Set: Created 4 years 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 "chrome/browser/ui/views/frame/browser_frame.h" 9 #include "chrome/browser/ui/views/frame/browser_frame.h"
10 #include "chrome/browser/ui/views/frame/browser_view.h" 10 #include "chrome/browser/ui/views/frame/browser_view.h"
11 #include "chrome/common/extensions/extension_constants.h" 11 #include "chrome/common/extensions/extension_constants.h"
12 #include "services/ui/public/cpp/property_type_converters.h" 12 #include "services/ui/public/cpp/property_type_converters.h"
13 #include "services/ui/public/cpp/window.h"
13 #include "services/ui/public/interfaces/window_tree.mojom.h" 14 #include "services/ui/public/interfaces/window_tree.mojom.h"
14 #include "ui/views/mus/desktop_window_tree_host_mus.h" 15 #include "ui/views/mus/window_manager_connection.h"
15 #include "ui/views/mus/mus_client.h"
16 #include "ui/views/mus/window_manager_frame_values.h" 16 #include "ui/views/mus/window_manager_frame_values.h"
17 17
18 BrowserFrameMus::BrowserFrameMus(BrowserFrame* browser_frame, 18 namespace {
19 BrowserView* browser_view)
20 : views::DesktopNativeWidgetAura(browser_frame),
21 browser_frame_(browser_frame),
22 browser_view_(browser_view) {}
23 19
24 BrowserFrameMus::~BrowserFrameMus() {} 20 views::Widget::InitParams GetWidgetParamsImpl(BrowserView* browser_view) {
21 views::Widget::InitParams params;
22 params.bounds = gfx::Rect(10, 10, 640, 480);
23 params.delegate = browser_view;
24 return params;
25 }
25 26
26 views::Widget::InitParams BrowserFrameMus::GetWidgetParams() { 27 ui::Window* CreateMusWindow(BrowserView* browser_view) {
27 views::Widget::InitParams params; 28 std::map<std::string, std::vector<uint8_t>> properties;
28 params.native_widget = this; 29 views::NativeWidgetMus::ConfigurePropertiesForNewWindow(
29 params.bounds = gfx::Rect(10, 10, 640, 480); 30 GetWidgetParamsImpl(browser_view), &properties);
30 params.delegate = browser_view_;
31 std::map<std::string, std::vector<uint8_t>> properties =
32 views::MusClient::ConfigurePropertiesFromParams(params);
33 const std::string chrome_app_id(extension_misc::kChromeAppId); 31 const std::string chrome_app_id(extension_misc::kChromeAppId);
34 // Indicates mash shouldn't handle immersive, rather we will. 32 // Indicates mash shouldn't handle immersive, rather we will.
35 properties[ui::mojom::WindowManager::kDisableImmersive_InitProperty] = 33 properties[ui::mojom::WindowManager::kDisableImmersive_InitProperty] =
36 mojo::ConvertTo<std::vector<uint8_t>>(true); 34 mojo::ConvertTo<std::vector<uint8_t>>(true);
37 properties[ui::mojom::WindowManager::kAppID_Property] = 35 properties[ui::mojom::WindowManager::kAppID_Property] =
38 mojo::ConvertTo<std::vector<uint8_t>>(chrome_app_id); 36 mojo::ConvertTo<std::vector<uint8_t>>(chrome_app_id);
39 std::unique_ptr<views::DesktopWindowTreeHostMus> desktop_window_tree_host = 37 return views::WindowManagerConnection::Get()->NewTopLevelWindow(properties);
40 base::MakeUnique<views::DesktopWindowTreeHostMus>(browser_frame_, this, 38 }
41 &properties); 39
42 // BrowserNonClientFrameViewMus::OnBoundsChanged() takes care of updating 40 } // namespace
43 // the insets. 41
44 desktop_window_tree_host->set_auto_update_client_area(false); 42 BrowserFrameMus::BrowserFrameMus(BrowserFrame* browser_frame,
45 SetDesktopWindowTreeHost(std::move(desktop_window_tree_host)); 43 BrowserView* browser_view)
44 : views::NativeWidgetMus(browser_frame,
45 CreateMusWindow(browser_view),
46 ui::mojom::CompositorFrameSinkType::DEFAULT),
47 browser_view_(browser_view) {}
48
49 BrowserFrameMus::~BrowserFrameMus() {}
50
51 views::Widget::InitParams BrowserFrameMus::GetWidgetParams() {
52 views::Widget::InitParams params(GetWidgetParamsImpl(browser_view_));
53 params.native_widget = this;
46 return params; 54 return params;
47 } 55 }
48 56
49 bool BrowserFrameMus::UseCustomFrame() const { 57 bool BrowserFrameMus::UseCustomFrame() const {
50 return true; 58 return true;
51 } 59 }
52 60
53 bool BrowserFrameMus::UsesNativeSystemMenu() const { 61 bool BrowserFrameMus::UsesNativeSystemMenu() const {
54 return false; 62 return false;
55 } 63 }
(...skipping 14 matching lines...) Expand all
70 } 78 }
71 79
72 bool BrowserFrameMus::HandleKeyboardEvent( 80 bool BrowserFrameMus::HandleKeyboardEvent(
73 const content::NativeWebKeyboardEvent& event) { 81 const content::NativeWebKeyboardEvent& event) {
74 return false; 82 return false;
75 } 83 }
76 84
77 int BrowserFrameMus::GetMinimizeButtonOffset() const { 85 int BrowserFrameMus::GetMinimizeButtonOffset() const {
78 return 0; 86 return 0;
79 } 87 }
88
89 void BrowserFrameMus::UpdateClientArea() {
90 // BrowserNonClientFrameViewMus::OnBoundsChanged() takes care of updating
91 // the insets.
92 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_frame_mus.h ('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