| 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" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "chrome/common/extensions/request_media_access_permission_helper.h" | 34 #include "chrome/common/extensions/request_media_access_permission_helper.h" |
| 35 #include "content/public/browser/invalidate_type.h" | 35 #include "content/public/browser/invalidate_type.h" |
| 36 #include "content/public/browser/navigation_entry.h" | 36 #include "content/public/browser/navigation_entry.h" |
| 37 #include "content/public/browser/notification_details.h" | 37 #include "content/public/browser/notification_details.h" |
| 38 #include "content/public/browser/notification_service.h" | 38 #include "content/public/browser/notification_service.h" |
| 39 #include "content/public/browser/notification_source.h" | 39 #include "content/public/browser/notification_source.h" |
| 40 #include "content/public/browser/notification_types.h" | 40 #include "content/public/browser/notification_types.h" |
| 41 #include "content/public/browser/render_view_host.h" | 41 #include "content/public/browser/render_view_host.h" |
| 42 #include "content/public/browser/resource_dispatcher_host.h" | 42 #include "content/public/browser/resource_dispatcher_host.h" |
| 43 #include "content/public/browser/web_contents.h" | 43 #include "content/public/browser/web_contents.h" |
| 44 #include "content/public/common/content_constants.h" |
| 44 #include "content/public/common/media_stream_request.h" | 45 #include "content/public/common/media_stream_request.h" |
| 45 #include "skia/ext/image_operations.h" | 46 #include "skia/ext/image_operations.h" |
| 46 #include "third_party/skia/include/core/SkRegion.h" | 47 #include "third_party/skia/include/core/SkRegion.h" |
| 47 #include "ui/gfx/image/image_skia.h" | 48 #include "ui/gfx/image/image_skia.h" |
| 48 | 49 |
| 49 #if defined(USE_ASH) | 50 #if defined(USE_ASH) |
| 50 #include "ash/launcher/launcher_types.h" | 51 #include "ash/launcher/launcher_types.h" |
| 51 #endif | 52 #endif |
| 52 | 53 |
| 53 using content::ConsoleMessageLevel; | 54 using content::ConsoleMessageLevel; |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 !web_contents()->GetController().GetActiveEntry() || | 352 !web_contents()->GetController().GetActiveEntry() || |
| 352 web_contents()->GetController().GetActiveEntry()->GetTitle().empty()) | 353 web_contents()->GetController().GetActiveEntry()->GetTitle().empty()) |
| 353 return UTF8ToUTF16(extension()->name()); | 354 return UTF8ToUTF16(extension()->name()); |
| 354 string16 title = web_contents()->GetTitle(); | 355 string16 title = web_contents()->GetTitle(); |
| 355 Browser::FormatTitleForDisplay(&title); | 356 Browser::FormatTitleForDisplay(&title); |
| 356 return title; | 357 return title; |
| 357 } | 358 } |
| 358 | 359 |
| 359 void ShellWindow::SetAppIconUrl(const GURL& url) { | 360 void ShellWindow::SetAppIconUrl(const GURL& url) { |
| 360 app_icon_url_ = url; | 361 app_icon_url_ = url; |
| 361 web_contents()->DownloadFavicon(url, kPreferredIconSize, | 362 web_contents()->DownloadFavicon(url, |
| 363 content::DOWNLOAD_FAVICON, |
| 364 kPreferredIconSize, |
| 362 base::Bind(&ShellWindow::DidDownloadFavicon, | 365 base::Bind(&ShellWindow::DidDownloadFavicon, |
| 363 weak_ptr_factory_.GetWeakPtr())); | 366 weak_ptr_factory_.GetWeakPtr())); |
| 364 } | 367 } |
| 365 | 368 |
| 366 void ShellWindow::UpdateDraggableRegions( | 369 void ShellWindow::UpdateDraggableRegions( |
| 367 const std::vector<extensions::DraggableRegion>& regions) { | 370 const std::vector<extensions::DraggableRegion>& regions) { |
| 368 native_app_window_->UpdateDraggableRegions(regions); | 371 native_app_window_->UpdateDraggableRegions(regions); |
| 369 } | 372 } |
| 370 | 373 |
| 371 void ShellWindow::UpdateAppIcon(const gfx::Image& image) { | 374 void ShellWindow::UpdateAppIcon(const gfx::Image& image) { |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 const extensions::DraggableRegion& region = *iter; | 531 const extensions::DraggableRegion& region = *iter; |
| 529 sk_region->op( | 532 sk_region->op( |
| 530 region.bounds.x(), | 533 region.bounds.x(), |
| 531 region.bounds.y(), | 534 region.bounds.y(), |
| 532 region.bounds.right(), | 535 region.bounds.right(), |
| 533 region.bounds.bottom(), | 536 region.bounds.bottom(), |
| 534 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); | 537 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); |
| 535 } | 538 } |
| 536 return sk_region; | 539 return sk_region; |
| 537 } | 540 } |
| OLD | NEW |