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

Side by Side Diff: ash/common/frame/header_view.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
« no previous file with comments | « ash/common/frame/header_view.h ('k') | ash/mus/frame/custom_frame_view_mus.h » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ash/common/frame/header_view.h" 5 #include "ash/common/frame/header_view.h"
6 6
7 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h " 7 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h "
8 #include "ash/common/frame/default_header_painter.h" 8 #include "ash/common/frame/default_header_painter.h"
9 #include "ash/common/session/session_state_delegate.h" 9 #include "ash/common/session/session_state_delegate.h"
10 #include "ash/common/wm_shell.h" 10 #include "ash/common/wm_shell.h"
11 #include "ash/common/wm_window.h" 11 #include "ash/common/wm_window.h"
12 #include "ui/gfx/canvas.h" 12 #include "ui/gfx/canvas.h"
13 #include "ui/views/controls/image_view.h" 13 #include "ui/views/controls/image_view.h"
14 #include "ui/views/widget/widget.h" 14 #include "ui/views/widget/widget.h"
15 15
16 namespace ash { 16 namespace ash {
17 17
18 HeaderView::HeaderView(views::Widget* target_widget) 18 HeaderView::HeaderView(views::Widget* target_widget,
19 mojom::WindowStyle window_style)
19 : target_widget_(target_widget), 20 : target_widget_(target_widget),
20 header_painter_(new DefaultHeaderPainter), 21 header_painter_(base::MakeUnique<DefaultHeaderPainter>(window_style)),
21 avatar_icon_(nullptr), 22 avatar_icon_(nullptr),
22 caption_button_container_(nullptr), 23 caption_button_container_(nullptr),
23 fullscreen_visible_fraction_(0) { 24 fullscreen_visible_fraction_(0) {
24 caption_button_container_ = 25 caption_button_container_ =
25 new FrameCaptionButtonContainerView(target_widget_); 26 new FrameCaptionButtonContainerView(target_widget_);
26 caption_button_container_->UpdateSizeButtonVisibility(); 27 caption_button_container_->UpdateSizeButtonVisibility();
27 AddChildView(caption_button_container_); 28 AddChildView(caption_button_container_);
28 29
29 header_painter_->Init(target_widget_, this, caption_button_container_); 30 header_painter_->Init(target_widget_, this, caption_button_container_);
30 UpdateAvatarIcon(); 31 UpdateAvatarIcon();
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 gfx::Rect visible_bounds(GetVisibleBounds()); 193 gfx::Rect visible_bounds(GetVisibleBounds());
193 gfx::Point visible_origin_in_screen(visible_bounds.origin()); 194 gfx::Point visible_origin_in_screen(visible_bounds.origin());
194 views::View::ConvertPointToScreen(this, &visible_origin_in_screen); 195 views::View::ConvertPointToScreen(this, &visible_origin_in_screen);
195 std::vector<gfx::Rect> bounds_in_screen; 196 std::vector<gfx::Rect> bounds_in_screen;
196 bounds_in_screen.push_back( 197 bounds_in_screen.push_back(
197 gfx::Rect(visible_origin_in_screen, visible_bounds.size())); 198 gfx::Rect(visible_origin_in_screen, visible_bounds.size()));
198 return bounds_in_screen; 199 return bounds_in_screen;
199 } 200 }
200 201
201 } // namespace ash 202 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/frame/header_view.h ('k') | ash/mus/frame/custom_frame_view_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698