| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/shell_window.h" | 5 #include "chrome/browser/ui/extensions/shell_window.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/extensions/app_window_contents.h" | 9 #include "chrome/browser/extensions/app_window_contents.h" |
| 10 #include "chrome/browser/extensions/extension_process_manager.h" | 10 #include "chrome/browser/extensions/extension_process_manager.h" |
| 11 #include "chrome/browser/extensions/extension_system.h" | 11 #include "chrome/browser/extensions/extension_system.h" |
| 12 #include "chrome/browser/extensions/image_loader.h" | 12 #include "chrome/browser/extensions/image_loader.h" |
| 13 #include "chrome/browser/extensions/shell_window_geometry_cache.h" | 13 #include "chrome/browser/extensions/shell_window_geometry_cache.h" |
| 14 #include "chrome/browser/extensions/shell_window_registry.h" | 14 #include "chrome/browser/extensions/shell_window_registry.h" |
| 15 #include "chrome/browser/extensions/suggest_permission_util.h" | 15 #include "chrome/browser/extensions/suggest_permission_util.h" |
| 16 #include "chrome/browser/favicon/favicon_tab_helper.h" | 16 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 17 #include "chrome/browser/file_select_helper.h" | 17 #include "chrome/browser/file_select_helper.h" |
| 18 #include "chrome/browser/lifetime/application_lifetime.h" | 18 #include "chrome/browser/lifetime/application_lifetime.h" |
| 19 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 19 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
| 20 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
| 21 #include "chrome/browser/sessions/session_id.h" | 21 #include "chrome/browser/sessions/session_id.h" |
| 22 #include "chrome/browser/ui/browser.h" | 22 #include "chrome/browser/ui/browser.h" |
| 23 #include "chrome/browser/ui/browser_finder.h" | 23 #include "chrome/browser/ui/browser_finder.h" |
| 24 #include "chrome/browser/ui/browser_tabstrip.h" | 24 #include "chrome/browser/ui/browser_tabstrip.h" |
| 25 #include "chrome/browser/ui/browser_window.h" | 25 #include "chrome/browser/ui/browser_window.h" |
| 26 #include "chrome/browser/ui/extensions/native_app_window.h" | 26 #include "chrome/browser/ui/extensions/native_app_window.h" |
| 27 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" | 27 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" |
| 28 #include "chrome/browser/view_type_utils.h" | 28 #include "chrome/browser/view_type_utils.h" |
| 29 #include "chrome/common/chrome_notification_types.h" | 29 #include "chrome/common/chrome_notification_types.h" |
| 30 #include "chrome/common/extensions/api/icons/icons_handler.h" |
| 30 #include "chrome/common/extensions/extension.h" | 31 #include "chrome/common/extensions/extension.h" |
| 31 #include "chrome/common/extensions/extension_constants.h" | 32 #include "chrome/common/extensions/extension_constants.h" |
| 32 #include "chrome/common/extensions/extension_messages.h" | 33 #include "chrome/common/extensions/extension_messages.h" |
| 33 #include "chrome/common/extensions/request_media_access_permission_helper.h" | 34 #include "chrome/common/extensions/request_media_access_permission_helper.h" |
| 34 #include "content/public/browser/invalidate_type.h" | 35 #include "content/public/browser/invalidate_type.h" |
| 35 #include "content/public/browser/navigation_entry.h" | 36 #include "content/public/browser/navigation_entry.h" |
| 36 #include "content/public/browser/notification_details.h" | 37 #include "content/public/browser/notification_details.h" |
| 37 #include "content/public/browser/notification_service.h" | 38 #include "content/public/browser/notification_service.h" |
| 38 #include "content/public/browser/notification_source.h" | 39 #include "content/public/browser/notification_source.h" |
| 39 #include "content/public/browser/notification_types.h" | 40 #include "content/public/browser/notification_types.h" |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 } | 403 } |
| 403 | 404 |
| 404 void ShellWindow::UpdateExtensionAppIcon() { | 405 void ShellWindow::UpdateExtensionAppIcon() { |
| 405 // Ensure previously enqueued callbacks are ignored. | 406 // Ensure previously enqueued callbacks are ignored. |
| 406 image_loader_ptr_factory_.InvalidateWeakPtrs(); | 407 image_loader_ptr_factory_.InvalidateWeakPtrs(); |
| 407 | 408 |
| 408 // Enqueue OnImageLoaded callback. | 409 // Enqueue OnImageLoaded callback. |
| 409 extensions::ImageLoader* loader = extensions::ImageLoader::Get(profile()); | 410 extensions::ImageLoader* loader = extensions::ImageLoader::Get(profile()); |
| 410 loader->LoadImageAsync( | 411 loader->LoadImageAsync( |
| 411 extension(), | 412 extension(), |
| 412 extension()->GetIconResource(kPreferredIconSize, | 413 extensions::IconsInfo::GetIconResource(extension(), |
| 413 ExtensionIconSet::MATCH_BIGGER), | 414 kPreferredIconSize, |
| 415 ExtensionIconSet::MATCH_BIGGER), |
| 414 gfx::Size(kPreferredIconSize, kPreferredIconSize), | 416 gfx::Size(kPreferredIconSize, kPreferredIconSize), |
| 415 base::Bind(&ShellWindow::OnImageLoaded, | 417 base::Bind(&ShellWindow::OnImageLoaded, |
| 416 image_loader_ptr_factory_.GetWeakPtr())); | 418 image_loader_ptr_factory_.GetWeakPtr())); |
| 417 } | 419 } |
| 418 | 420 |
| 419 void ShellWindow::CloseContents(WebContents* contents) { | 421 void ShellWindow::CloseContents(WebContents* contents) { |
| 420 native_app_window_->Close(); | 422 native_app_window_->Close(); |
| 421 } | 423 } |
| 422 | 424 |
| 423 bool ShellWindow::ShouldSuppressDialogs() { | 425 bool ShellWindow::ShouldSuppressDialogs() { |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 const extensions::DraggableRegion& region = *iter; | 528 const extensions::DraggableRegion& region = *iter; |
| 527 sk_region->op( | 529 sk_region->op( |
| 528 region.bounds.x(), | 530 region.bounds.x(), |
| 529 region.bounds.y(), | 531 region.bounds.y(), |
| 530 region.bounds.right(), | 532 region.bounds.right(), |
| 531 region.bounds.bottom(), | 533 region.bounds.bottom(), |
| 532 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); | 534 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); |
| 533 } | 535 } |
| 534 return sk_region; | 536 return sk_region; |
| 535 } | 537 } |
| OLD | NEW |