Chromium Code Reviews| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 #include "content/public/common/media_stream_request.h" | 23 #include "content/public/common/media_stream_request.h" |
| 24 #include "extensions/browser/app_window/app_delegate.h" | 24 #include "extensions/browser/app_window/app_delegate.h" |
| 25 #include "extensions/browser/app_window/app_web_contents_helper.h" | 25 #include "extensions/browser/app_window/app_web_contents_helper.h" |
| 26 #include "extensions/browser/app_window/app_window_client.h" | 26 #include "extensions/browser/app_window/app_window_client.h" |
| 27 #include "extensions/browser/app_window/app_window_geometry_cache.h" | 27 #include "extensions/browser/app_window/app_window_geometry_cache.h" |
| 28 #include "extensions/browser/app_window/app_window_registry.h" | 28 #include "extensions/browser/app_window/app_window_registry.h" |
| 29 #include "extensions/browser/app_window/native_app_window.h" | 29 #include "extensions/browser/app_window/native_app_window.h" |
| 30 #include "extensions/browser/app_window/size_constraints.h" | 30 #include "extensions/browser/app_window/size_constraints.h" |
| 31 #include "extensions/browser/extension_registry.h" | 31 #include "extensions/browser/extension_registry.h" |
| 32 #include "extensions/browser/extension_system.h" | 32 #include "extensions/browser/extension_system.h" |
| 33 #include "extensions/browser/extension_web_contents_observer.h" | |
| 33 #include "extensions/browser/extensions_browser_client.h" | 34 #include "extensions/browser/extensions_browser_client.h" |
| 34 #include "extensions/browser/notification_types.h" | 35 #include "extensions/browser/notification_types.h" |
| 35 #include "extensions/browser/process_manager.h" | 36 #include "extensions/browser/process_manager.h" |
| 36 #include "extensions/browser/suggest_permission_util.h" | 37 #include "extensions/browser/suggest_permission_util.h" |
| 37 #include "extensions/browser/view_type_utils.h" | 38 #include "extensions/browser/view_type_utils.h" |
| 38 #include "extensions/common/draggable_region.h" | 39 #include "extensions/common/draggable_region.h" |
| 39 #include "extensions/common/extension.h" | 40 #include "extensions/common/extension.h" |
| 40 #include "extensions/common/manifest_handlers/icons_handler.h" | 41 #include "extensions/common/manifest_handlers/icons_handler.h" |
| 41 #include "extensions/common/permissions/permissions_data.h" | 42 #include "extensions/common/permissions/permissions_data.h" |
| 42 #include "extensions/common/switches.h" | 43 #include "extensions/common/switches.h" |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 251 // Initialize the render interface and web contents | 252 // Initialize the render interface and web contents |
| 252 app_window_contents_.reset(app_window_contents); | 253 app_window_contents_.reset(app_window_contents); |
| 253 app_window_contents_->Initialize(browser_context(), url); | 254 app_window_contents_->Initialize(browser_context(), url); |
| 254 | 255 |
| 255 initial_url_ = url; | 256 initial_url_ = url; |
| 256 | 257 |
| 257 content::WebContentsObserver::Observe(web_contents()); | 258 content::WebContentsObserver::Observe(web_contents()); |
| 258 SetViewType(web_contents(), VIEW_TYPE_APP_WINDOW); | 259 SetViewType(web_contents(), VIEW_TYPE_APP_WINDOW); |
| 259 app_delegate_->InitWebContents(web_contents()); | 260 app_delegate_->InitWebContents(web_contents()); |
| 260 | 261 |
| 262 ExtensionWebContentsObserver::GetForWebContents(web_contents())-> | |
|
not at google - send to devlin
2015/06/10 20:48:12
Lack of a CreateForWebContents here is a bit puzzl
Devlin
2015/06/10 20:59:20
Yep, they're created up the stack. In this partic
| |
| 263 dispatcher()->set_delegate(this); | |
| 264 | |
| 261 WebContentsModalDialogManager::CreateForWebContents(web_contents()); | 265 WebContentsModalDialogManager::CreateForWebContents(web_contents()); |
| 262 | 266 |
| 263 web_contents()->SetDelegate(this); | 267 web_contents()->SetDelegate(this); |
| 264 WebContentsModalDialogManager::FromWebContents(web_contents()) | 268 WebContentsModalDialogManager::FromWebContents(web_contents()) |
| 265 ->SetDelegate(this); | 269 ->SetDelegate(this); |
| 266 | 270 |
| 267 // Initialize the window | 271 // Initialize the window |
| 268 CreateParams new_params = LoadDefaults(params); | 272 CreateParams new_params = LoadDefaults(params); |
| 269 window_type_ = new_params.window_type; | 273 window_type_ = new_params.window_type; |
| 270 window_key_ = new_params.window_key; | 274 window_key_ = new_params.window_key; |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 915 const { | 919 const { |
| 916 return IsHtmlApiFullscreen(); | 920 return IsHtmlApiFullscreen(); |
| 917 } | 921 } |
| 918 | 922 |
| 919 blink::WebDisplayMode AppWindow::GetDisplayMode( | 923 blink::WebDisplayMode AppWindow::GetDisplayMode( |
| 920 const content::WebContents* source) const { | 924 const content::WebContents* source) const { |
| 921 return IsFullscreen() ? blink::WebDisplayModeFullscreen | 925 return IsFullscreen() ? blink::WebDisplayModeFullscreen |
| 922 : blink::WebDisplayModeStandalone; | 926 : blink::WebDisplayModeStandalone; |
| 923 } | 927 } |
| 924 | 928 |
| 929 WindowController* AppWindow::GetExtensionWindowController() const { | |
| 930 return app_window_contents_->GetWindowController(); | |
| 931 } | |
| 932 | |
| 933 content::WebContents* AppWindow::GetAssociatedWebContents() const { | |
| 934 return web_contents(); | |
| 935 } | |
| 936 | |
| 925 void AppWindow::OnExtensionUnloaded(BrowserContext* browser_context, | 937 void AppWindow::OnExtensionUnloaded(BrowserContext* browser_context, |
| 926 const Extension* extension, | 938 const Extension* extension, |
| 927 UnloadedExtensionInfo::Reason reason) { | 939 UnloadedExtensionInfo::Reason reason) { |
| 928 if (extension_id_ == extension->id()) | 940 if (extension_id_ == extension->id()) |
| 929 native_app_window_->Close(); | 941 native_app_window_->Close(); |
| 930 } | 942 } |
| 931 | 943 |
| 932 void AppWindow::OnExtensionWillBeInstalled( | 944 void AppWindow::OnExtensionWillBeInstalled( |
| 933 BrowserContext* browser_context, | 945 BrowserContext* browser_context, |
| 934 const Extension* extension, | 946 const Extension* extension, |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1061 region.bounds.x(), | 1073 region.bounds.x(), |
| 1062 region.bounds.y(), | 1074 region.bounds.y(), |
| 1063 region.bounds.right(), | 1075 region.bounds.right(), |
| 1064 region.bounds.bottom(), | 1076 region.bounds.bottom(), |
| 1065 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); | 1077 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); |
| 1066 } | 1078 } |
| 1067 return sk_region; | 1079 return sk_region; |
| 1068 } | 1080 } |
| 1069 | 1081 |
| 1070 } // namespace extensions | 1082 } // namespace extensions |
| OLD | NEW |