| 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_contents.h" | |
| 8 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 9 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 11 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 12 #include "base/values.h" | 11 #include "base/values.h" |
| 13 #include "chrome/common/extensions/api/app_window.h" | 12 #include "chrome/common/extensions/api/app_window.h" |
| 14 #include "content/public/browser/notification_registrar.h" | 13 #include "content/public/browser/notification_registrar.h" |
| 15 #include "content/public/browser/notification_types.h" | 14 #include "content/public/browser/notification_types.h" |
| 16 #include "content/public/browser/render_process_host.h" | 15 #include "content/public/browser/render_process_host.h" |
| 17 #include "content/public/browser/render_view_host.h" | 16 #include "content/public/browser/render_view_host.h" |
| 18 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
| 19 #include "content/public/common/url_constants.h" | 18 #include "content/public/common/url_constants.h" |
| 20 #include "extensions/browser/app_window/app_window.h" | 19 #include "extensions/browser/app_window/app_window.h" |
| 20 #include "extensions/browser/app_window/app_window_contents.h" |
| 21 #include "extensions/browser/app_window/app_window_registry.h" | 21 #include "extensions/browser/app_window/app_window_registry.h" |
| 22 #include "extensions/browser/app_window/apps_client.h" | 22 #include "extensions/browser/app_window/apps_client.h" |
| 23 #include "extensions/browser/app_window/native_app_window.h" | 23 #include "extensions/browser/app_window/native_app_window.h" |
| 24 #include "extensions/browser/extensions_browser_client.h" | 24 #include "extensions/browser/extensions_browser_client.h" |
| 25 #include "extensions/browser/image_util.h" | 25 #include "extensions/browser/image_util.h" |
| 26 #include "extensions/common/features/simple_feature.h" | 26 #include "extensions/common/features/simple_feature.h" |
| 27 #include "extensions/common/permissions/permissions_data.h" | 27 #include "extensions/common/permissions/permissions_data.h" |
| 28 #include "extensions/common/switches.h" | 28 #include "extensions/common/switches.h" |
| 29 #include "third_party/skia/include/core/SkColor.h" | 29 #include "third_party/skia/include/core/SkColor.h" |
| 30 #include "ui/base/ui_base_types.h" | 30 #include "ui/base/ui_base_types.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 break; | 273 break; |
| 274 } | 274 } |
| 275 } | 275 } |
| 276 } | 276 } |
| 277 | 277 |
| 278 create_params.creator_process_id = | 278 create_params.creator_process_id = |
| 279 render_view_host_->GetProcess()->GetID(); | 279 render_view_host_->GetProcess()->GetID(); |
| 280 | 280 |
| 281 AppWindow* app_window = | 281 AppWindow* app_window = |
| 282 AppsClient::Get()->CreateAppWindow(browser_context(), extension()); | 282 AppsClient::Get()->CreateAppWindow(browser_context(), extension()); |
| 283 app_window->Init( | 283 app_window->Init(url, new AppWindowContentsImpl(app_window), create_params); |
| 284 url, new apps::AppWindowContentsImpl(app_window), create_params); | |
| 285 | 284 |
| 286 if (ExtensionsBrowserClient::Get()->IsRunningInForcedAppMode()) | 285 if (ExtensionsBrowserClient::Get()->IsRunningInForcedAppMode()) |
| 287 app_window->ForcedFullscreen(); | 286 app_window->ForcedFullscreen(); |
| 288 | 287 |
| 289 content::RenderViewHost* created_view = | 288 content::RenderViewHost* created_view = |
| 290 app_window->web_contents()->GetRenderViewHost(); | 289 app_window->web_contents()->GetRenderViewHost(); |
| 291 int view_id = MSG_ROUTING_NONE; | 290 int view_id = MSG_ROUTING_NONE; |
| 292 if (create_params.creator_process_id == created_view->GetProcess()->GetID()) | 291 if (create_params.creator_process_id == created_view->GetProcess()->GetID()) |
| 293 view_id = created_view->GetRoutingID(); | 292 view_id = created_view->GetRoutingID(); |
| 294 | 293 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 | 488 |
| 490 if (options.frame->as_frame_options->inactive_color.get()) { | 489 if (options.frame->as_frame_options->inactive_color.get()) { |
| 491 error_ = app_window_constants::kInactiveColorWithoutColor; | 490 error_ = app_window_constants::kInactiveColorWithoutColor; |
| 492 return false; | 491 return false; |
| 493 } | 492 } |
| 494 | 493 |
| 495 return true; | 494 return true; |
| 496 } | 495 } |
| 497 | 496 |
| 498 } // namespace extensions | 497 } // namespace extensions |
| OLD | NEW |