OLD | NEW |
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/apps/chrome_native_app_window_views_aura.h" | 5 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views_aura.h" |
6 | 6 |
7 #include "apps/ui/views/app_window_frame_view.h" | 7 #include "apps/ui/views/app_window_frame_view.h" |
8 #include "ash/ash_constants.h" | 8 #include "ash/ash_constants.h" |
9 #include "ash/frame/custom_frame_view_ash.h" | 9 #include "ash/frame/custom_frame_view_ash.h" |
10 #include "ash/screen_util.h" | 10 #include "ash/screen_util.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 init_params, | 167 init_params, |
168 widget); | 168 widget); |
169 | 169 |
170 if (ash::Shell::HasInstance() && use_default_bounds) { | 170 if (ash::Shell::HasInstance() && use_default_bounds) { |
171 // Open a new panel on the target root. | 171 // Open a new panel on the target root. |
172 init_params->bounds = ash::ScreenUtil::ConvertRectToScreen( | 172 init_params->bounds = ash::ScreenUtil::ConvertRectToScreen( |
173 ash::Shell::GetTargetRootWindow(), gfx::Rect(GetPreferredSize())); | 173 ash::Shell::GetTargetRootWindow(), gfx::Rect(GetPreferredSize())); |
174 } | 174 } |
175 } | 175 } |
176 | 176 |
177 apps::AppWindowFrameView* | 177 views::NonClientFrameView* |
178 ChromeNativeAppWindowViewsAura::CreateNonStandardAppFrame() { | 178 ChromeNativeAppWindowViewsAura::CreateNonStandardAppFrame() { |
179 apps::AppWindowFrameView* frame = | 179 apps::AppWindowFrameView* frame = |
180 ChromeNativeAppWindowViews::CreateNonStandardAppFrame(); | 180 new apps::AppWindowFrameView(widget(), this, HasFrameColor(), |
| 181 ActiveFrameColor(), InactiveFrameColor()); |
| 182 frame->Init(); |
181 | 183 |
182 // For Aura windows on the Ash desktop the sizes are different and the user | 184 // For Aura windows on the Ash desktop the sizes are different and the user |
183 // can resize the window from slightly outside the bounds as well. | 185 // can resize the window from slightly outside the bounds as well. |
184 if (chrome::IsNativeWindowInAsh(widget()->GetNativeWindow())) { | 186 if (chrome::IsNativeWindowInAsh(widget()->GetNativeWindow())) { |
185 frame->SetResizeSizes(ash::kResizeInsideBoundsSize, | 187 frame->SetResizeSizes(ash::kResizeInsideBoundsSize, |
186 ash::kResizeOutsideBoundsSize, | 188 ash::kResizeOutsideBoundsSize, |
187 ash::kResizeAreaCornerSize); | 189 ash::kResizeAreaCornerSize); |
188 } | 190 } |
189 | 191 |
190 #if !defined(OS_CHROMEOS) | 192 #if !defined(OS_CHROMEOS) |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 ChromeNativeAppWindowViews::UpdateShape(region.Pass()); | 369 ChromeNativeAppWindowViews::UpdateShape(region.Pass()); |
368 | 370 |
369 aura::Window* native_window = widget()->GetNativeWindow(); | 371 aura::Window* native_window = widget()->GetNativeWindow(); |
370 if (shape() && !had_shape) { | 372 if (shape() && !had_shape) { |
371 native_window->SetEventTargeter(scoped_ptr<ui::EventTargeter>( | 373 native_window->SetEventTargeter(scoped_ptr<ui::EventTargeter>( |
372 new ShapedAppWindowTargeter(native_window, this))); | 374 new ShapedAppWindowTargeter(native_window, this))); |
373 } else if (!shape() && had_shape) { | 375 } else if (!shape() && had_shape) { |
374 native_window->SetEventTargeter(scoped_ptr<ui::EventTargeter>()); | 376 native_window->SetEventTargeter(scoped_ptr<ui::EventTargeter>()); |
375 } | 377 } |
376 } | 378 } |
OLD | NEW |