| 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/color_chooser.h" |
| 26 #include "chrome/browser/ui/extensions/native_app_window.h" | 27 #include "chrome/browser/ui/extensions/native_app_window.h" |
| 27 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" | 28 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" |
| 28 #include "chrome/common/chrome_notification_types.h" | 29 #include "chrome/common/chrome_notification_types.h" |
| 29 #include "chrome/common/extensions/api/icons/icons_handler.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" |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 } | 469 } |
| 469 | 470 |
| 470 void ShellWindow::CloseContents(WebContents* contents) { | 471 void ShellWindow::CloseContents(WebContents* contents) { |
| 471 native_app_window_->Close(); | 472 native_app_window_->Close(); |
| 472 } | 473 } |
| 473 | 474 |
| 474 bool ShellWindow::ShouldSuppressDialogs() { | 475 bool ShellWindow::ShouldSuppressDialogs() { |
| 475 return true; | 476 return true; |
| 476 } | 477 } |
| 477 | 478 |
| 479 content::ColorChooser* ShellWindow::OpenColorChooser(WebContents* web_contents, |
| 480 SkColor initial_color) { |
| 481 return ColorChooser::Open(web_contents, initial_color); |
| 482 } |
| 483 |
| 478 void ShellWindow::RunFileChooser(WebContents* tab, | 484 void ShellWindow::RunFileChooser(WebContents* tab, |
| 479 const content::FileChooserParams& params) { | 485 const content::FileChooserParams& params) { |
| 480 FileSelectHelper::RunFileChooser(tab, params); | 486 FileSelectHelper::RunFileChooser(tab, params); |
| 481 } | 487 } |
| 482 | 488 |
| 483 bool ShellWindow::IsPopupOrPanel(const WebContents* source) const { | 489 bool ShellWindow::IsPopupOrPanel(const WebContents* source) const { |
| 484 return true; | 490 return true; |
| 485 } | 491 } |
| 486 | 492 |
| 487 void ShellWindow::MoveContents(WebContents* source, const gfx::Rect& pos) { | 493 void ShellWindow::MoveContents(WebContents* source, const gfx::Rect& pos) { |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 const extensions::DraggableRegion& region = *iter; | 598 const extensions::DraggableRegion& region = *iter; |
| 593 sk_region->op( | 599 sk_region->op( |
| 594 region.bounds.x(), | 600 region.bounds.x(), |
| 595 region.bounds.y(), | 601 region.bounds.y(), |
| 596 region.bounds.right(), | 602 region.bounds.right(), |
| 597 region.bounds.bottom(), | 603 region.bounds.bottom(), |
| 598 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); | 604 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); |
| 599 } | 605 } |
| 600 return sk_region; | 606 return sk_region; |
| 601 } | 607 } |
| OLD | NEW |