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" | |
29 #include "chrome/common/chrome_notification_types.h" | 28 #include "chrome/common/chrome_notification_types.h" |
30 #include "chrome/common/extensions/api/icons/icons_handler.h" | 29 #include "chrome/common/extensions/api/icons/icons_handler.h" |
31 #include "chrome/common/extensions/extension.h" | 30 #include "chrome/common/extensions/extension.h" |
32 #include "chrome/common/extensions/extension_constants.h" | 31 #include "chrome/common/extensions/extension_constants.h" |
33 #include "chrome/common/extensions/extension_messages.h" | 32 #include "chrome/common/extensions/extension_messages.h" |
34 #include "chrome/common/extensions/request_media_access_permission_helper.h" | 33 #include "chrome/common/extensions/request_media_access_permission_helper.h" |
35 #include "content/public/browser/invalidate_type.h" | 34 #include "content/public/browser/invalidate_type.h" |
36 #include "content/public/browser/navigation_entry.h" | 35 #include "content/public/browser/navigation_entry.h" |
37 #include "content/public/browser/notification_details.h" | 36 #include "content/public/browser/notification_details.h" |
38 #include "content/public/browser/notification_service.h" | 37 #include "content/public/browser/notification_service.h" |
39 #include "content/public/browser/notification_source.h" | 38 #include "content/public/browser/notification_source.h" |
40 #include "content/public/browser/notification_types.h" | 39 #include "content/public/browser/notification_types.h" |
41 #include "content/public/browser/render_view_host.h" | 40 #include "content/public/browser/render_view_host.h" |
42 #include "content/public/browser/resource_dispatcher_host.h" | 41 #include "content/public/browser/resource_dispatcher_host.h" |
43 #include "content/public/browser/web_contents.h" | 42 #include "content/public/browser/web_contents.h" |
44 #include "content/public/common/media_stream_request.h" | 43 #include "content/public/common/media_stream_request.h" |
| 44 #include "extensions/browser/view_type_utils.h" |
45 #include "skia/ext/image_operations.h" | 45 #include "skia/ext/image_operations.h" |
46 #include "third_party/skia/include/core/SkRegion.h" | 46 #include "third_party/skia/include/core/SkRegion.h" |
47 #include "ui/gfx/image/image_skia.h" | 47 #include "ui/gfx/image/image_skia.h" |
48 | 48 |
49 #if defined(USE_ASH) | 49 #if defined(USE_ASH) |
50 #include "ash/launcher/launcher_types.h" | 50 #include "ash/launcher/launcher_types.h" |
51 #endif | 51 #endif |
52 | 52 |
53 using content::ConsoleMessageLevel; | 53 using content::ConsoleMessageLevel; |
54 using content::WebContents; | 54 using content::WebContents; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 ShellWindowContents* shell_window_contents, | 102 ShellWindowContents* shell_window_contents, |
103 const ShellWindow::CreateParams& params) { | 103 const ShellWindow::CreateParams& params) { |
104 // Initialize the render interface and web contents | 104 // Initialize the render interface and web contents |
105 shell_window_contents_.reset(shell_window_contents); | 105 shell_window_contents_.reset(shell_window_contents); |
106 shell_window_contents_->Initialize(profile(), url); | 106 shell_window_contents_->Initialize(profile(), url); |
107 WebContents* web_contents = shell_window_contents_->GetWebContents(); | 107 WebContents* web_contents = shell_window_contents_->GetWebContents(); |
108 WebContentsModalDialogManager::CreateForWebContents(web_contents); | 108 WebContentsModalDialogManager::CreateForWebContents(web_contents); |
109 FaviconTabHelper::CreateForWebContents(web_contents); | 109 FaviconTabHelper::CreateForWebContents(web_contents); |
110 | 110 |
111 web_contents->SetDelegate(this); | 111 web_contents->SetDelegate(this); |
112 chrome::SetViewType(web_contents, chrome::VIEW_TYPE_APP_SHELL); | 112 extensions::SetViewType(web_contents, extensions::VIEW_TYPE_APP_SHELL); |
113 | 113 |
114 // Initialize the window | 114 // Initialize the window |
115 window_type_ = params.window_type; | 115 window_type_ = params.window_type; |
116 | 116 |
117 gfx::Rect bounds = params.bounds; | 117 gfx::Rect bounds = params.bounds; |
118 | 118 |
119 if (bounds.width() == 0) | 119 if (bounds.width() == 0) |
120 bounds.set_width(kDefaultWidth); | 120 bounds.set_width(kDefaultWidth); |
121 if (bounds.height() == 0) | 121 if (bounds.height() == 0) |
122 bounds.set_height(kDefaultHeight); | 122 bounds.set_height(kDefaultHeight); |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 const extensions::DraggableRegion& region = *iter; | 532 const extensions::DraggableRegion& region = *iter; |
533 sk_region->op( | 533 sk_region->op( |
534 region.bounds.x(), | 534 region.bounds.x(), |
535 region.bounds.y(), | 535 region.bounds.y(), |
536 region.bounds.right(), | 536 region.bounds.right(), |
537 region.bounds.bottom(), | 537 region.bounds.bottom(), |
538 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); | 538 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); |
539 } | 539 } |
540 return sk_region; | 540 return sk_region; |
541 } | 541 } |
OLD | NEW |