| 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/extension_process_manager.h" | 9 #include "chrome/browser/extensions/extension_process_manager.h" |
| 10 #include "chrome/browser/extensions/extension_system.h" | 10 #include "chrome/browser/extensions/extension_system.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "chrome/browser/ui/browser.h" | 23 #include "chrome/browser/ui/browser.h" |
| 24 #include "chrome/browser/ui/browser_finder.h" | 24 #include "chrome/browser/ui/browser_finder.h" |
| 25 #include "chrome/browser/ui/browser_tabstrip.h" | 25 #include "chrome/browser/ui/browser_tabstrip.h" |
| 26 #include "chrome/browser/ui/browser_window.h" | 26 #include "chrome/browser/ui/browser_window.h" |
| 27 #include "chrome/browser/ui/extensions/native_app_window.h" | 27 #include "chrome/browser/ui/extensions/native_app_window.h" |
| 28 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" | 28 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" |
| 29 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" | 29 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" |
| 30 #include "chrome/browser/view_type_utils.h" | 30 #include "chrome/browser/view_type_utils.h" |
| 31 #include "chrome/common/chrome_notification_types.h" | 31 #include "chrome/common/chrome_notification_types.h" |
| 32 #include "chrome/common/extensions/api/app_window.h" | 32 #include "chrome/common/extensions/api/app_window.h" |
| 33 #include "chrome/common/extensions/api/icons/icons_handler.h" |
| 33 #include "chrome/common/extensions/extension.h" | 34 #include "chrome/common/extensions/extension.h" |
| 34 #include "chrome/common/extensions/extension_constants.h" | 35 #include "chrome/common/extensions/extension_constants.h" |
| 35 #include "chrome/common/extensions/extension_messages.h" | 36 #include "chrome/common/extensions/extension_messages.h" |
| 36 #include "chrome/common/extensions/request_media_access_permission_helper.h" | 37 #include "chrome/common/extensions/request_media_access_permission_helper.h" |
| 37 #include "content/public/browser/browser_thread.h" | 38 #include "content/public/browser/browser_thread.h" |
| 38 #include "content/public/browser/invalidate_type.h" | 39 #include "content/public/browser/invalidate_type.h" |
| 39 #include "content/public/browser/navigation_entry.h" | 40 #include "content/public/browser/navigation_entry.h" |
| 40 #include "content/public/browser/notification_details.h" | 41 #include "content/public/browser/notification_details.h" |
| 41 #include "content/public/browser/notification_service.h" | 42 #include "content/public/browser/notification_service.h" |
| 42 #include "content/public/browser/notification_source.h" | 43 #include "content/public/browser/notification_source.h" |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 } | 475 } |
| 475 | 476 |
| 476 void ShellWindow::UpdateExtensionAppIcon() { | 477 void ShellWindow::UpdateExtensionAppIcon() { |
| 477 // Ensure previously enqueued callbacks are ignored. | 478 // Ensure previously enqueued callbacks are ignored. |
| 478 image_loader_ptr_factory_.InvalidateWeakPtrs(); | 479 image_loader_ptr_factory_.InvalidateWeakPtrs(); |
| 479 | 480 |
| 480 // Enqueue OnImageLoaded callback. | 481 // Enqueue OnImageLoaded callback. |
| 481 extensions::ImageLoader* loader = extensions::ImageLoader::Get(profile()); | 482 extensions::ImageLoader* loader = extensions::ImageLoader::Get(profile()); |
| 482 loader->LoadImageAsync( | 483 loader->LoadImageAsync( |
| 483 extension(), | 484 extension(), |
| 484 extension()->GetIconResource(kPreferredIconSize, | 485 extensions::IconsInfo::GetIconResource(extension(), |
| 485 ExtensionIconSet::MATCH_BIGGER), | 486 kPreferredIconSize, |
| 487 ExtensionIconSet::MATCH_BIGGER), |
| 486 gfx::Size(kPreferredIconSize, kPreferredIconSize), | 488 gfx::Size(kPreferredIconSize, kPreferredIconSize), |
| 487 base::Bind(&ShellWindow::OnImageLoaded, | 489 base::Bind(&ShellWindow::OnImageLoaded, |
| 488 image_loader_ptr_factory_.GetWeakPtr())); | 490 image_loader_ptr_factory_.GetWeakPtr())); |
| 489 } | 491 } |
| 490 | 492 |
| 491 void ShellWindow::CloseContents(WebContents* contents) { | 493 void ShellWindow::CloseContents(WebContents* contents) { |
| 492 DCHECK(contents == web_contents_); | 494 DCHECK(contents == web_contents_); |
| 493 native_app_window_->Close(); | 495 native_app_window_->Close(); |
| 494 } | 496 } |
| 495 | 497 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 const extensions::DraggableRegion& region = *iter; | 634 const extensions::DraggableRegion& region = *iter; |
| 633 sk_region->op( | 635 sk_region->op( |
| 634 region.bounds.x(), | 636 region.bounds.x(), |
| 635 region.bounds.y(), | 637 region.bounds.y(), |
| 636 region.bounds.right(), | 638 region.bounds.right(), |
| 637 region.bounds.bottom(), | 639 region.bounds.bottom(), |
| 638 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); | 640 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); |
| 639 } | 641 } |
| 640 return sk_region; | 642 return sk_region; |
| 641 } | 643 } |
| OLD | NEW |