| 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 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 } | 672 } |
| 673 chrome::DrawTaskbarDecoration(GetNativeWindow(), icon); | 673 chrome::DrawTaskbarDecoration(GetNativeWindow(), icon); |
| 674 } | 674 } |
| 675 | 675 |
| 676 void ChromeNativeAppWindowViews::UpdateShape(scoped_ptr<SkRegion> region) { | 676 void ChromeNativeAppWindowViews::UpdateShape(scoped_ptr<SkRegion> region) { |
| 677 bool had_shape = shape_; | 677 bool had_shape = shape_; |
| 678 shape_ = region.Pass(); | 678 shape_ = region.Pass(); |
| 679 | 679 |
| 680 aura::Window* native_window = widget()->GetNativeWindow(); | 680 aura::Window* native_window = widget()->GetNativeWindow(); |
| 681 if (shape_) { | 681 if (shape_) { |
| 682 widget()->SetShape(new SkRegion(*shape_)); |
| 682 native_window->layer()->SetAlphaShape( | 683 native_window->layer()->SetAlphaShape( |
| 683 make_scoped_ptr(new SkRegion(*shape_))); | 684 make_scoped_ptr(new SkRegion(*shape_))); |
| 684 if (!had_shape) { | 685 if (!had_shape) { |
| 685 native_window->SetEventTargeter(scoped_ptr<ui::EventTargeter>( | 686 native_window->SetEventTargeter(scoped_ptr<ui::EventTargeter>( |
| 686 new ShapedAppWindowTargeter(native_window, this))); | 687 new ShapedAppWindowTargeter(native_window, this))); |
| 687 } | 688 } |
| 688 } else { | 689 } else { |
| 689 widget()->SetShape(NULL); | 690 widget()->SetShape(NULL); |
| 690 if (had_shape) | 691 if (had_shape) |
| 691 native_window->SetEventTargeter(scoped_ptr<ui::EventTargeter>()); | 692 native_window->SetEventTargeter(scoped_ptr<ui::EventTargeter>()); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 718 InitializePanelWindow(create_params); | 719 InitializePanelWindow(create_params); |
| 719 } else { | 720 } else { |
| 720 InitializeDefaultWindow(create_params); | 721 InitializeDefaultWindow(create_params); |
| 721 } | 722 } |
| 722 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews( | 723 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews( |
| 723 Profile::FromBrowserContext(app_window->browser_context()), | 724 Profile::FromBrowserContext(app_window->browser_context()), |
| 724 widget()->GetFocusManager(), | 725 widget()->GetFocusManager(), |
| 725 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY, | 726 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY, |
| 726 NULL)); | 727 NULL)); |
| 727 } | 728 } |
| OLD | NEW |