| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/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" |
| 11 #include "chrome/browser/extensions/shell_window_geometry_cache.h" | 11 #include "chrome/browser/extensions/shell_window_geometry_cache.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 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/intents/web_intent_picker_controller.h" | 27 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" |
| 28 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" | 28 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" |
| 29 #include "chrome/browser/view_type_utils.h" | 29 #include "chrome/browser/view_type_utils.h" |
| 30 #include "chrome/common/chrome_notification_types.h" | 30 #include "chrome/common/chrome_notification_types.h" |
| 31 #include "chrome/common/extensions/api/app_window.h" | 31 #include "chrome/common/extensions/api/app_window.h" |
| 32 #include "chrome/common/extensions/api/icons/icons_handler.h" |
| 32 #include "chrome/common/extensions/extension.h" | 33 #include "chrome/common/extensions/extension.h" |
| 33 #include "chrome/common/extensions/extension_constants.h" | 34 #include "chrome/common/extensions/extension_constants.h" |
| 34 #include "chrome/common/extensions/extension_messages.h" | 35 #include "chrome/common/extensions/extension_messages.h" |
| 35 #include "chrome/common/extensions/request_media_access_permission_helper.h" | 36 #include "chrome/common/extensions/request_media_access_permission_helper.h" |
| 36 #include "content/public/browser/browser_thread.h" | 37 #include "content/public/browser/browser_thread.h" |
| 37 #include "content/public/browser/invalidate_type.h" | 38 #include "content/public/browser/invalidate_type.h" |
| 38 #include "content/public/browser/navigation_entry.h" | 39 #include "content/public/browser/navigation_entry.h" |
| 39 #include "content/public/browser/notification_details.h" | 40 #include "content/public/browser/notification_details.h" |
| 40 #include "content/public/browser/notification_service.h" | 41 #include "content/public/browser/notification_service.h" |
| 41 #include "content/public/browser/notification_source.h" | 42 #include "content/public/browser/notification_source.h" |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 return; | 472 return; |
| 472 app_icon_ = image; | 473 app_icon_ = image; |
| 473 native_app_window_->UpdateWindowIcon(); | 474 native_app_window_->UpdateWindowIcon(); |
| 474 extensions::ShellWindowRegistry::Get(profile_)->ShellWindowIconChanged(this); | 475 extensions::ShellWindowRegistry::Get(profile_)->ShellWindowIconChanged(this); |
| 475 } | 476 } |
| 476 | 477 |
| 477 void ShellWindow::UpdateExtensionAppIcon() { | 478 void ShellWindow::UpdateExtensionAppIcon() { |
| 478 app_icon_loader_.reset(new ImageLoadingTracker(this)); | 479 app_icon_loader_.reset(new ImageLoadingTracker(this)); |
| 479 app_icon_loader_->LoadImage( | 480 app_icon_loader_->LoadImage( |
| 480 extension(), | 481 extension(), |
| 481 extension()->GetIconResource(kPreferredIconSize, | 482 extensions::IconsInfo::GetIconResource(extension(), |
| 482 ExtensionIconSet::MATCH_BIGGER), | 483 kPreferredIconSize, |
| 484 ExtensionIconSet::MATCH_BIGGER), |
| 483 gfx::Size(kPreferredIconSize, kPreferredIconSize), | 485 gfx::Size(kPreferredIconSize, kPreferredIconSize), |
| 484 ImageLoadingTracker::CACHE); | 486 ImageLoadingTracker::CACHE); |
| 485 } | 487 } |
| 486 | 488 |
| 487 void ShellWindow::CloseContents(WebContents* contents) { | 489 void ShellWindow::CloseContents(WebContents* contents) { |
| 488 DCHECK(contents == web_contents_); | 490 DCHECK(contents == web_contents_); |
| 489 native_app_window_->Close(); | 491 native_app_window_->Close(); |
| 490 } | 492 } |
| 491 | 493 |
| 492 bool ShellWindow::ShouldSuppressDialogs() { | 494 bool ShellWindow::ShouldSuppressDialogs() { |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 const extensions::DraggableRegion& region = *iter; | 630 const extensions::DraggableRegion& region = *iter; |
| 629 sk_region->op( | 631 sk_region->op( |
| 630 region.bounds.x(), | 632 region.bounds.x(), |
| 631 region.bounds.y(), | 633 region.bounds.y(), |
| 632 region.bounds.right(), | 634 region.bounds.right(), |
| 633 region.bounds.bottom(), | 635 region.bounds.bottom(), |
| 634 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); | 636 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); |
| 635 } | 637 } |
| 636 return sk_region; | 638 return sk_region; |
| 637 } | 639 } |
| OLD | NEW |