| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/cocoa/apps/native_app_window_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/apps/native_app_window_cocoa.h" |
| 6 | 6 |
| 7 #include "apps/app_shim/extension_app_shim_handler_mac.h" | 7 #include "apps/app_shim/extension_app_shim_handler_mac.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
| 10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
| 11 #include "base/mac/sdk_forward_declarations.h" | 11 #include "base/mac/sdk_forward_declarations.h" |
| 12 #include "base/strings/sys_string_conversions.h" | 12 #include "base/strings/sys_string_conversions.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/ui/cocoa/browser_window_utils.h" | 14 #include "chrome/browser/ui/cocoa/browser_window_utils.h" |
| 15 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" | 15 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" |
| 16 #import "chrome/browser/ui/cocoa/custom_frame_view.h" | 16 #import "chrome/browser/ui/cocoa/custom_frame_view.h" |
| 17 #include "chrome/browser/ui/cocoa/extensions/extension_keybinding_registry_cocoa
.h" | 17 #include "chrome/browser/ui/cocoa/extensions/extension_keybinding_registry_cocoa
.h" |
| 18 #include "chrome/browser/ui/cocoa/extensions/extension_view_mac.h" | 18 #include "chrome/browser/ui/cocoa/extensions/extension_view_mac.h" |
| 19 #import "chrome/browser/ui/cocoa/nsview_additions.h" | |
| 20 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
| 21 #include "content/public/browser/native_web_keyboard_event.h" | 20 #include "content/public/browser/native_web_keyboard_event.h" |
| 22 #include "content/public/browser/render_widget_host_view.h" | 21 #include "content/public/browser/render_widget_host_view.h" |
| 23 #include "content/public/browser/web_contents.h" | 22 #include "content/public/browser/web_contents.h" |
| 24 #include "extensions/common/extension.h" | 23 #include "extensions/common/extension.h" |
| 25 #include "skia/ext/skia_utils_mac.h" | 24 #include "skia/ext/skia_utils_mac.h" |
| 26 #include "third_party/skia/include/core/SkRegion.h" | 25 #include "third_party/skia/include/core/SkRegion.h" |
| 27 #include "ui/gfx/skia_util.h" | 26 #include "ui/gfx/skia_util.h" |
| 28 | 27 |
| 29 // NOTE: State Before Update. | 28 // NOTE: State Before Update. |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 initWithContentRect:cocoa_bounds | 358 initWithContentRect:cocoa_bounds |
| 360 styleMask:GetWindowStyleMask() | 359 styleMask:GetWindowStyleMask() |
| 361 backing:NSBackingStoreBuffered | 360 backing:NSBackingStoreBuffered |
| 362 defer:NO]); | 361 defer:NO]); |
| 363 | 362 |
| 364 std::string name; | 363 std::string name; |
| 365 const extensions::Extension* extension = app_window_->GetExtension(); | 364 const extensions::Extension* extension = app_window_->GetExtension(); |
| 366 if (extension) | 365 if (extension) |
| 367 name = extension->name(); | 366 name = extension->name(); |
| 368 [window setTitle:base::SysUTF8ToNSString(name)]; | 367 [window setTitle:base::SysUTF8ToNSString(name)]; |
| 369 [[window contentView] cr_setWantsLayer:YES]; | 368 [[window contentView] setWantsLayer:YES]; |
| 370 if (has_frame_ && has_frame_color_) { | 369 if (has_frame_ && has_frame_color_) { |
| 371 [base::mac::ObjCCastStrict<ShellCustomFrameNSWindow>(window) | 370 [base::mac::ObjCCastStrict<ShellCustomFrameNSWindow>(window) |
| 372 setColor:gfx::SkColorToSRGBNSColor(active_frame_color_) | 371 setColor:gfx::SkColorToSRGBNSColor(active_frame_color_) |
| 373 inactiveColor:gfx::SkColorToSRGBNSColor(inactive_frame_color_)]; | 372 inactiveColor:gfx::SkColorToSRGBNSColor(inactive_frame_color_)]; |
| 374 } | 373 } |
| 375 | 374 |
| 376 if (base::mac::IsOSSnowLeopard() && | 375 if (base::mac::IsOSSnowLeopard() && |
| 377 [window respondsToSelector:@selector(setBottomCornerRounded:)]) | 376 [window respondsToSelector:@selector(setBottomCornerRounded:)]) |
| 378 [window setBottomCornerRounded:NO]; | 377 [window setBottomCornerRounded:NO]; |
| 379 | 378 |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 } | 988 } |
| 990 | 989 |
| 991 void NativeAppWindowCocoa::UpdateRestoredBounds() { | 990 void NativeAppWindowCocoa::UpdateRestoredBounds() { |
| 992 if (IsRestored(*this)) | 991 if (IsRestored(*this)) |
| 993 restored_bounds_ = [window() frame]; | 992 restored_bounds_ = [window() frame]; |
| 994 } | 993 } |
| 995 | 994 |
| 996 void NativeAppWindowCocoa::HideWithoutMarkingHidden() { | 995 void NativeAppWindowCocoa::HideWithoutMarkingHidden() { |
| 997 [window() orderOut:window_controller_]; | 996 [window() orderOut:window_controller_]; |
| 998 } | 997 } |
| OLD | NEW |