| 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/extensions/api/app_window/app_window_api.h" | 5 #include "chrome/browser/extensions/api/app_window/app_window_api.h" |
| 6 | 6 |
| 7 #include "apps/app_window.h" | 7 #include "apps/app_window.h" |
| 8 #include "apps/app_window_contents.h" | 8 #include "apps/app_window_contents.h" |
| 9 #include "apps/app_window_registry.h" | 9 #include "apps/app_window_registry.h" |
| 10 #include "apps/apps_client.h" |
| 10 #include "apps/ui/native_app_window.h" | 11 #include "apps/ui/native_app_window.h" |
| 11 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 12 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 13 #include "base/values.h" | 14 #include "base/values.h" |
| 14 #include "chrome/browser/app_mode/app_mode_utils.h" | 15 #include "chrome/browser/app_mode/app_mode_utils.h" |
| 15 #include "chrome/browser/devtools/devtools_window.h" | 16 #include "chrome/browser/devtools/devtools_window.h" |
| 16 #include "chrome/browser/extensions/window_controller.h" | 17 #include "chrome/browser/extensions/window_controller.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/ui/apps/chrome_app_window_delegate.h" | |
| 19 #include "chrome/common/extensions/api/app_window.h" | 19 #include "chrome/common/extensions/api/app_window.h" |
| 20 #include "chrome/common/extensions/features/feature_channel.h" | 20 #include "chrome/common/extensions/features/feature_channel.h" |
| 21 #include "content/public/browser/notification_registrar.h" | 21 #include "content/public/browser/notification_registrar.h" |
| 22 #include "content/public/browser/notification_types.h" | 22 #include "content/public/browser/notification_types.h" |
| 23 #include "content/public/browser/render_process_host.h" | 23 #include "content/public/browser/render_process_host.h" |
| 24 #include "content/public/browser/render_view_host.h" | 24 #include "content/public/browser/render_view_host.h" |
| 25 #include "content/public/browser/web_contents.h" | 25 #include "content/public/browser/web_contents.h" |
| 26 #include "content/public/common/url_constants.h" | 26 #include "content/public/common/url_constants.h" |
| 27 #include "extensions/browser/extensions_browser_client.h" | 27 #include "extensions/browser/extensions_browser_client.h" |
| 28 #include "extensions/common/switches.h" | 28 #include "extensions/common/switches.h" |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 case extensions::api::app_window::STATE_MINIMIZED: | 258 case extensions::api::app_window::STATE_MINIMIZED: |
| 259 create_params.state = ui::SHOW_STATE_MINIMIZED; | 259 create_params.state = ui::SHOW_STATE_MINIMIZED; |
| 260 break; | 260 break; |
| 261 } | 261 } |
| 262 } | 262 } |
| 263 } | 263 } |
| 264 | 264 |
| 265 create_params.creator_process_id = | 265 create_params.creator_process_id = |
| 266 render_view_host_->GetProcess()->GetID(); | 266 render_view_host_->GetProcess()->GetID(); |
| 267 | 267 |
| 268 AppWindow* app_window = new AppWindow( | 268 AppWindow* app_window = |
| 269 GetProfile(), new ChromeAppWindowDelegate(), GetExtension()); | 269 apps::AppsClient::Get()->CreateAppWindow(GetProfile(), GetExtension()); |
| 270 app_window->Init( | 270 app_window->Init( |
| 271 url, new apps::AppWindowContentsImpl(app_window), create_params); | 271 url, new apps::AppWindowContentsImpl(app_window), create_params); |
| 272 | 272 |
| 273 if (chrome::IsRunningInForcedAppMode()) | 273 if (chrome::IsRunningInForcedAppMode()) |
| 274 app_window->ForcedFullscreen(); | 274 app_window->ForcedFullscreen(); |
| 275 | 275 |
| 276 content::RenderViewHost* created_view = | 276 content::RenderViewHost* created_view = |
| 277 app_window->web_contents()->GetRenderViewHost(); | 277 app_window->web_contents()->GetRenderViewHost(); |
| 278 int view_id = MSG_ROUTING_NONE; | 278 int view_id = MSG_ROUTING_NONE; |
| 279 if (create_params.creator_process_id == created_view->GetProcess()->GetID()) | 279 if (create_params.creator_process_id == created_view->GetProcess()->GetID()) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 291 ->HadDevToolsAttached(created_view)) { | 291 ->HadDevToolsAttached(created_view)) { |
| 292 new DevToolsRestorer(this, created_view); | 292 new DevToolsRestorer(this, created_view); |
| 293 return true; | 293 return true; |
| 294 } | 294 } |
| 295 | 295 |
| 296 SendResponse(true); | 296 SendResponse(true); |
| 297 return true; | 297 return true; |
| 298 } | 298 } |
| 299 | 299 |
| 300 } // namespace extensions | 300 } // namespace extensions |
| OLD | NEW |