OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/app_window/app_window.h" | 5 #include "extensions/browser/app_window/app_window.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
11 #include <utility> | 11 #include <utility> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/callback_helpers.h" | 14 #include "base/callback_helpers.h" |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "base/memory/ptr_util.h" |
16 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
17 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
18 #include "base/task_runner.h" | 19 #include "base/task_runner.h" |
19 #include "base/threading/thread_task_runner_handle.h" | 20 #include "base/threading/thread_task_runner_handle.h" |
20 #include "base/values.h" | 21 #include "base/values.h" |
21 #include "build/build_config.h" | 22 #include "build/build_config.h" |
22 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 23 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
23 #include "content/public/browser/browser_context.h" | 24 #include "content/public/browser/browser_context.h" |
24 #include "content/public/browser/invalidate_type.h" | 25 #include "content/public/browser/invalidate_type.h" |
25 #include "content/public/browser/navigation_entry.h" | 26 #include "content/public/browser/navigation_entry.h" |
(...skipping 11 matching lines...) Expand all Loading... |
37 #include "extensions/browser/app_window/app_window_registry.h" | 38 #include "extensions/browser/app_window/app_window_registry.h" |
38 #include "extensions/browser/app_window/native_app_window.h" | 39 #include "extensions/browser/app_window/native_app_window.h" |
39 #include "extensions/browser/app_window/size_constraints.h" | 40 #include "extensions/browser/app_window/size_constraints.h" |
40 #include "extensions/browser/extension_registry.h" | 41 #include "extensions/browser/extension_registry.h" |
41 #include "extensions/browser/extension_system.h" | 42 #include "extensions/browser/extension_system.h" |
42 #include "extensions/browser/extension_web_contents_observer.h" | 43 #include "extensions/browser/extension_web_contents_observer.h" |
43 #include "extensions/browser/extensions_browser_client.h" | 44 #include "extensions/browser/extensions_browser_client.h" |
44 #include "extensions/browser/notification_types.h" | 45 #include "extensions/browser/notification_types.h" |
45 #include "extensions/browser/process_manager.h" | 46 #include "extensions/browser/process_manager.h" |
46 #include "extensions/browser/suggest_permission_util.h" | 47 #include "extensions/browser/suggest_permission_util.h" |
| 48 #include "extensions/browser/ui/extension_bluetooth_chooser.h" |
47 #include "extensions/browser/view_type_utils.h" | 49 #include "extensions/browser/view_type_utils.h" |
48 #include "extensions/common/draggable_region.h" | 50 #include "extensions/common/draggable_region.h" |
49 #include "extensions/common/extension.h" | 51 #include "extensions/common/extension.h" |
50 #include "extensions/common/manifest_handlers/icons_handler.h" | 52 #include "extensions/common/manifest_handlers/icons_handler.h" |
51 #include "extensions/common/permissions/permissions_data.h" | 53 #include "extensions/common/permissions/permissions_data.h" |
52 #include "extensions/common/switches.h" | 54 #include "extensions/common/switches.h" |
53 #include "extensions/grit/extensions_browser_resources.h" | 55 #include "extensions/grit/extensions_browser_resources.h" |
54 #include "third_party/skia/include/core/SkRegion.h" | 56 #include "third_party/skia/include/core/SkRegion.h" |
55 #include "ui/base/resource/resource_bundle.h" | 57 #include "ui/base/resource/resource_bundle.h" |
56 #include "ui/display/display.h" | 58 #include "ui/display/display.h" |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 bool last_unlocked_by_target) { | 438 bool last_unlocked_by_target) { |
437 DCHECK_EQ(AppWindow::web_contents(), web_contents); | 439 DCHECK_EQ(AppWindow::web_contents(), web_contents); |
438 helper_->RequestToLockMouse(); | 440 helper_->RequestToLockMouse(); |
439 } | 441 } |
440 | 442 |
441 bool AppWindow::PreHandleGestureEvent(WebContents* source, | 443 bool AppWindow::PreHandleGestureEvent(WebContents* source, |
442 const blink::WebGestureEvent& event) { | 444 const blink::WebGestureEvent& event) { |
443 return AppWebContentsHelper::ShouldSuppressGestureEvent(event); | 445 return AppWebContentsHelper::ShouldSuppressGestureEvent(event); |
444 } | 446 } |
445 | 447 |
| 448 std::unique_ptr<content::BluetoothChooser> AppWindow::RunBluetoothChooser( |
| 449 content::RenderFrameHost* frame, |
| 450 const content::BluetoothChooser::EventHandler& event_handler) { |
| 451 return base::WrapUnique( |
| 452 new extensions::ExtensionBluetoothChooser(frame, event_handler)); |
| 453 } |
| 454 |
446 void AppWindow::RenderViewCreated(content::RenderViewHost* render_view_host) { | 455 void AppWindow::RenderViewCreated(content::RenderViewHost* render_view_host) { |
447 app_delegate_->RenderViewCreated(render_view_host); | 456 app_delegate_->RenderViewCreated(render_view_host); |
448 } | 457 } |
449 | 458 |
450 void AppWindow::DidFirstVisuallyNonEmptyPaint() { | 459 void AppWindow::DidFirstVisuallyNonEmptyPaint() { |
451 first_paint_complete_ = true; | 460 first_paint_complete_ = true; |
452 if (show_on_first_paint_) { | 461 if (show_on_first_paint_) { |
453 DCHECK(delayed_show_type_ == SHOW_ACTIVE || | 462 DCHECK(delayed_show_type_ == SHOW_ACTIVE || |
454 delayed_show_type_ == SHOW_INACTIVE); | 463 delayed_show_type_ == SHOW_INACTIVE); |
455 Show(delayed_show_type_); | 464 Show(delayed_show_type_); |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 region.bounds.x(), | 1126 region.bounds.x(), |
1118 region.bounds.y(), | 1127 region.bounds.y(), |
1119 region.bounds.right(), | 1128 region.bounds.right(), |
1120 region.bounds.bottom(), | 1129 region.bounds.bottom(), |
1121 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); | 1130 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); |
1122 } | 1131 } |
1123 return sk_region; | 1132 return sk_region; |
1124 } | 1133 } |
1125 | 1134 |
1126 } // namespace extensions | 1135 } // namespace extensions |
OLD | NEW |