| 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" | 7 #include "apps/app_window_contents.h" |
| 8 #include "apps/native_app_window.h" | 8 #include "apps/native_app_window.h" |
| 9 #include "apps/shell_window.h" | 9 #include "apps/shell_window.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "chrome/browser/app_mode/app_mode_utils.h" | 13 #include "chrome/browser/app_mode/app_mode_utils.h" |
| 14 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
| 15 #include "chrome/browser/devtools/devtools_window.h" | 15 #include "chrome/browser/devtools/devtools_window.h" |
| 16 #include "chrome/browser/extensions/shell_window_registry.h" | 16 #include "chrome/browser/extensions/shell_window_registry.h" |
| 17 #include "chrome/browser/extensions/window_controller.h" | 17 #include "chrome/browser/extensions/window_controller.h" |
| 18 #include "chrome/browser/ui/apps/chrome_shell_window_delegate.h" | 18 #include "chrome/browser/ui/apps/chrome_shell_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.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/common/switches.h" | 27 #include "extensions/common/switches.h" |
| 28 #include "ui/base/ui_base_types.h" | 28 #include "ui/base/ui_base_types.h" |
| 29 #include "ui/gfx/rect.h" | 29 #include "ui/gfx/rect.h" |
| 30 #include "url/gurl.h" | 30 #include "url/gurl.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 if (bounds->width.get()) | 200 if (bounds->width.get()) |
| 201 create_params.bounds.set_width(*bounds->width.get()); | 201 create_params.bounds.set_width(*bounds->width.get()); |
| 202 if (bounds->height.get()) | 202 if (bounds->height.get()) |
| 203 create_params.bounds.set_height(*bounds->height.get()); | 203 create_params.bounds.set_height(*bounds->height.get()); |
| 204 if (bounds->left.get()) | 204 if (bounds->left.get()) |
| 205 create_params.bounds.set_x(*bounds->left.get()); | 205 create_params.bounds.set_x(*bounds->left.get()); |
| 206 if (bounds->top.get()) | 206 if (bounds->top.get()) |
| 207 create_params.bounds.set_y(*bounds->top.get()); | 207 create_params.bounds.set_y(*bounds->top.get()); |
| 208 } | 208 } |
| 209 | 209 |
| 210 if (Feature::GetCurrentChannel() <= chrome::VersionInfo::CHANNEL_DEV || | 210 if (GetCurrentChannel() <= chrome::VersionInfo::CHANNEL_DEV || |
| 211 GetExtension()->location() == extensions::Manifest::COMPONENT) { | 211 GetExtension()->location() == extensions::Manifest::COMPONENT) { |
| 212 if (options->type == extensions::api::app_window::WINDOW_TYPE_PANEL) { | 212 if (options->type == extensions::api::app_window::WINDOW_TYPE_PANEL) { |
| 213 create_params.window_type = ShellWindow::WINDOW_TYPE_PANEL; | 213 create_params.window_type = ShellWindow::WINDOW_TYPE_PANEL; |
| 214 } | 214 } |
| 215 } | 215 } |
| 216 | 216 |
| 217 if (options->frame.get()) { | 217 if (options->frame.get()) { |
| 218 if (*options->frame == kHtmlFrameOption && | 218 if (*options->frame == kHtmlFrameOption && |
| 219 CommandLine::ForCurrentProcess()->HasSwitch( | 219 CommandLine::ForCurrentProcess()->HasSwitch( |
| 220 switches::kEnableExperimentalExtensionApis)) { | 220 switches::kEnableExperimentalExtensionApis)) { |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 if (ShellWindowRegistry::Get(profile())->HadDevToolsAttached(created_view)) { | 321 if (ShellWindowRegistry::Get(profile())->HadDevToolsAttached(created_view)) { |
| 322 new DevToolsRestorer(this, created_view); | 322 new DevToolsRestorer(this, created_view); |
| 323 return true; | 323 return true; |
| 324 } | 324 } |
| 325 | 325 |
| 326 SendResponse(true); | 326 SendResponse(true); |
| 327 return true; | 327 return true; |
| 328 } | 328 } |
| 329 | 329 |
| 330 } // namespace extensions | 330 } // namespace extensions |
| OLD | NEW |