OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/views/frame/browser_frame_mus.h" |
| 6 |
| 7 #include "chrome/browser/ui/views/frame/browser_frame.h" |
| 8 #include "components/mus/public/interfaces/window_tree.mojom.h" |
| 9 #include "mojo/application/public/cpp/application_impl.h" |
| 10 #include "ui/views/mus/window_manager_connection.h" |
| 11 |
| 12 BrowserFrameMus::BrowserFrameMus(BrowserFrame* browser_frame, |
| 13 BrowserView* browser_view) |
| 14 : views::NativeWidgetMus( |
| 15 browser_frame, |
| 16 views::WindowManagerConnection::Get()->app()->shell(), |
| 17 views::WindowManagerConnection::Get()->NewWindow( |
| 18 std::map<std::string, std::vector<uint8_t>>()), |
| 19 mus::mojom::SURFACE_TYPE_DEFAULT), |
| 20 browser_view_(browser_view) { |
| 21 } |
| 22 |
| 23 BrowserFrameMus::~BrowserFrameMus() {} |
| 24 |
| 25 views::Widget::InitParams BrowserFrameMus::GetWidgetParams() { |
| 26 views::Widget::InitParams params; |
| 27 params.native_widget = this; |
| 28 params.bounds = gfx::Rect(10, 10, 640, 480); |
| 29 return params; |
| 30 } |
| 31 |
| 32 bool BrowserFrameMus::UseCustomFrame() const { |
| 33 return true; |
| 34 } |
| 35 |
| 36 bool BrowserFrameMus::UsesNativeSystemMenu() const { |
| 37 return false; |
| 38 } |
| 39 |
| 40 bool BrowserFrameMus::ShouldSaveWindowPlacement() const { |
| 41 return false; |
| 42 } |
| 43 |
| 44 void BrowserFrameMus::GetWindowPlacement( |
| 45 gfx::Rect* bounds, ui::WindowShowState* show_state) const { |
| 46 *bounds = gfx::Rect(10, 10, 800, 600); |
| 47 *show_state = ui::SHOW_STATE_NORMAL; |
| 48 } |
| 49 |
| 50 int BrowserFrameMus::GetMinimizeButtonOffset() const { |
| 51 return 0; |
| 52 } |
OLD | NEW |