| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.h" | 5 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views.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 "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/browser/app_mode/app_mode_utils.h" | 10 #include "chrome/browser/app_mode/app_mode_utils.h" |
| (...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 chrome::DrawTaskbarDecoration(GetNativeWindow(), icon); | 666 chrome::DrawTaskbarDecoration(GetNativeWindow(), icon); |
| 667 } | 667 } |
| 668 | 668 |
| 669 void ChromeNativeAppWindowViews::UpdateShape(scoped_ptr<SkRegion> region) { | 669 void ChromeNativeAppWindowViews::UpdateShape(scoped_ptr<SkRegion> region) { |
| 670 bool had_shape = shape_; | 670 bool had_shape = shape_; |
| 671 shape_ = region.Pass(); | 671 shape_ = region.Pass(); |
| 672 | 672 |
| 673 aura::Window* native_window = widget()->GetNativeWindow(); | 673 aura::Window* native_window = widget()->GetNativeWindow(); |
| 674 if (shape_) { | 674 if (shape_) { |
| 675 widget()->SetShape(new SkRegion(*shape_)); | 675 widget()->SetShape(new SkRegion(*shape_)); |
| 676 native_window->layer()->SetAlphaShape( | |
| 677 make_scoped_ptr(new SkRegion(*shape_))); | |
| 678 if (!had_shape) { | 676 if (!had_shape) { |
| 679 native_window->SetEventTargeter(scoped_ptr<ui::EventTargeter>( | 677 native_window->SetEventTargeter(scoped_ptr<ui::EventTargeter>( |
| 680 new ShapedAppWindowTargeter(native_window, this))); | 678 new ShapedAppWindowTargeter(native_window, this))); |
| 681 } | 679 } |
| 682 } else { | 680 } else { |
| 683 widget()->SetShape(NULL); | 681 widget()->SetShape(NULL); |
| 684 if (had_shape) | 682 if (had_shape) |
| 685 native_window->SetEventTargeter(scoped_ptr<ui::EventTargeter>()); | 683 native_window->SetEventTargeter(scoped_ptr<ui::EventTargeter>()); |
| 686 } | 684 } |
| 687 } | 685 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 712 InitializePanelWindow(create_params); | 710 InitializePanelWindow(create_params); |
| 713 } else { | 711 } else { |
| 714 InitializeDefaultWindow(create_params); | 712 InitializeDefaultWindow(create_params); |
| 715 } | 713 } |
| 716 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews( | 714 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews( |
| 717 Profile::FromBrowserContext(app_window->browser_context()), | 715 Profile::FromBrowserContext(app_window->browser_context()), |
| 718 widget()->GetFocusManager(), | 716 widget()->GetFocusManager(), |
| 719 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY, | 717 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY, |
| 720 NULL)); | 718 NULL)); |
| 721 } | 719 } |
| OLD | NEW |