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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 // WindowStateDelegate if one is not already set. | 318 // WindowStateDelegate if one is not already set. |
319 ash::wm::GetWindowState(GetNativeWindow()) | 319 ash::wm::GetWindowState(GetNativeWindow()) |
320 ->SetDelegate( | 320 ->SetDelegate( |
321 scoped_ptr<ash::wm::WindowStateDelegate>( | 321 scoped_ptr<ash::wm::WindowStateDelegate>( |
322 new NativeAppWindowStateDelegate(app_window(), this)).Pass()); | 322 new NativeAppWindowStateDelegate(app_window(), this)).Pass()); |
323 | 323 |
324 if (IsFrameless()) | 324 if (IsFrameless()) |
325 return CreateNonStandardAppFrame(); | 325 return CreateNonStandardAppFrame(); |
326 | 326 |
327 if (app_window()->window_type_is_panel()) { | 327 if (app_window()->window_type_is_panel()) { |
328 views::NonClientFrameView* frame_view = | 328 ash::PanelFrameView* frame_view = |
329 new ash::PanelFrameView(widget, ash::PanelFrameView::FRAME_ASH); | 329 new ash::PanelFrameView(widget, ash::PanelFrameView::FRAME_ASH); |
330 frame_view->set_context_menu_controller(this); | 330 frame_view->set_context_menu_controller(this); |
| 331 if (HasFrameColor()) |
| 332 frame_view->SetFrameColors(ActiveFrameColor(), InactiveFrameColor()); |
331 return frame_view; | 333 return frame_view; |
332 } | 334 } |
333 | 335 |
334 ash::CustomFrameViewAsh* custom_frame_view = | 336 ash::CustomFrameViewAsh* custom_frame_view = |
335 new ash::CustomFrameViewAsh(widget); | 337 new ash::CustomFrameViewAsh(widget); |
336 // Non-frameless app windows can be put into immersive fullscreen. | 338 // Non-frameless app windows can be put into immersive fullscreen. |
337 immersive_fullscreen_controller_.reset( | 339 immersive_fullscreen_controller_.reset( |
338 new ash::ImmersiveFullscreenController()); | 340 new ash::ImmersiveFullscreenController()); |
339 custom_frame_view->InitImmersiveFullscreenControllerForView( | 341 custom_frame_view->InitImmersiveFullscreenControllerForView( |
340 immersive_fullscreen_controller_.get()); | 342 immersive_fullscreen_controller_.get()); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 ChromeNativeAppWindowViews::UpdateShape(region.Pass()); | 379 ChromeNativeAppWindowViews::UpdateShape(region.Pass()); |
378 | 380 |
379 aura::Window* native_window = widget()->GetNativeWindow(); | 381 aura::Window* native_window = widget()->GetNativeWindow(); |
380 if (shape() && !had_shape) { | 382 if (shape() && !had_shape) { |
381 native_window->SetEventTargeter(scoped_ptr<ui::EventTargeter>( | 383 native_window->SetEventTargeter(scoped_ptr<ui::EventTargeter>( |
382 new ShapedAppWindowTargeter(native_window, this))); | 384 new ShapedAppWindowTargeter(native_window, this))); |
383 } else if (!shape() && had_shape) { | 385 } else if (!shape() && had_shape) { |
384 native_window->SetEventTargeter(scoped_ptr<ui::EventTargeter>()); | 386 native_window->SetEventTargeter(scoped_ptr<ui::EventTargeter>()); |
385 } | 387 } |
386 } | 388 } |
OLD | NEW |