| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/time.h" | 8 #include "base/time.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/app_mode/app_mode_utils.h" | 10 #include "chrome/browser/app_mode/app_mode_utils.h" |
| 11 #include "chrome/browser/devtools/devtools_window.h" | 11 #include "chrome/browser/devtools/devtools_window.h" |
| 12 #include "chrome/browser/extensions/shell_window_registry.h" | 12 #include "chrome/browser/extensions/shell_window_registry.h" |
| 13 #include "chrome/browser/extensions/window_controller.h" | 13 #include "chrome/browser/extensions/window_controller.h" |
| 14 #include "chrome/browser/ui/extensions/native_app_window.h" | 14 #include "chrome/browser/ui/extensions/native_app_window.h" |
| 15 #include "chrome/browser/ui/extensions/shell_window.h" | 15 #include "chrome/browser/ui/extensions/shell_window.h" |
| 16 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
| 17 #include "chrome/common/extensions/api/app_window.h" | 17 #include "chrome/common/extensions/api/app_window.h" |
| 18 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
| 19 #include "content/public/browser/notification_types.h" | 19 #include "content/public/browser/notification_types.h" |
| 20 #include "content/public/browser/render_process_host.h" | 20 #include "content/public/browser/render_process_host.h" |
| 21 #include "content/public/browser/render_view_host.h" | 21 #include "content/public/browser/render_view_host.h" |
| 22 #include "content/public/browser/web_contents.h" | 22 #include "content/public/browser/web_contents.h" |
| 23 #include "content/public/common/url_constants.h" | 23 #include "content/public/common/url_constants.h" |
| 24 #include "googleurl/src/gurl.h" | 24 #include "googleurl/src/gurl.h" |
| 25 #include "ui/base/ui_base_types.h" |
| 25 #include "ui/gfx/rect.h" | 26 #include "ui/gfx/rect.h" |
| 26 | 27 |
| 27 namespace app_window = extensions::api::app_window; | 28 namespace app_window = extensions::api::app_window; |
| 28 namespace Create = app_window::Create; | 29 namespace Create = app_window::Create; |
| 29 | 30 |
| 30 namespace extensions { | 31 namespace extensions { |
| 31 | 32 |
| 32 namespace app_window_constants { | 33 namespace app_window_constants { |
| 33 const char kInvalidWindowId[] = | 34 const char kInvalidWindowId[] = |
| 34 "The window id can not be more than 256 characters long."; | 35 "The window id can not be more than 256 characters long."; |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 | 212 |
| 212 if (options->resizable.get()) | 213 if (options->resizable.get()) |
| 213 create_params.resizable = *options->resizable.get(); | 214 create_params.resizable = *options->resizable.get(); |
| 214 | 215 |
| 215 if (options->type != extensions::api::app_window::WINDOW_TYPE_PANEL) { | 216 if (options->type != extensions::api::app_window::WINDOW_TYPE_PANEL) { |
| 216 switch (options->state) { | 217 switch (options->state) { |
| 217 case extensions::api::app_window::STATE_NONE: | 218 case extensions::api::app_window::STATE_NONE: |
| 218 case extensions::api::app_window::STATE_NORMAL: | 219 case extensions::api::app_window::STATE_NORMAL: |
| 219 break; | 220 break; |
| 220 case extensions::api::app_window::STATE_FULLSCREEN: | 221 case extensions::api::app_window::STATE_FULLSCREEN: |
| 221 create_params.state = ShellWindow::CreateParams::STATE_FULLSCREEN; | 222 create_params.state = ui::SHOW_STATE_FULLSCREEN; |
| 222 break; | 223 break; |
| 223 case extensions::api::app_window::STATE_MAXIMIZED: | 224 case extensions::api::app_window::STATE_MAXIMIZED: |
| 224 create_params.state = ShellWindow::CreateParams::STATE_MAXIMIZED; | 225 create_params.state = ui::SHOW_STATE_MAXIMIZED; |
| 225 break; | 226 break; |
| 226 case extensions::api::app_window::STATE_MINIMIZED: | 227 case extensions::api::app_window::STATE_MINIMIZED: |
| 227 create_params.state = ShellWindow::CreateParams::STATE_MINIMIZED; | 228 create_params.state = ui::SHOW_STATE_MINIMIZED; |
| 228 break; | 229 break; |
| 229 } | 230 } |
| 230 } | 231 } |
| 231 } | 232 } |
| 232 | 233 |
| 233 create_params.creator_process_id = | 234 create_params.creator_process_id = |
| 234 render_view_host_->GetProcess()->GetID(); | 235 render_view_host_->GetProcess()->GetID(); |
| 235 | 236 |
| 236 ShellWindow* shell_window = | 237 ShellWindow* shell_window = |
| 237 ShellWindow::Create(profile(), GetExtension(), url, create_params); | 238 ShellWindow::Create(profile(), GetExtension(), url, create_params); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 262 if (ShellWindowRegistry::Get(profile())->HadDevToolsAttached(created_view)) { | 263 if (ShellWindowRegistry::Get(profile())->HadDevToolsAttached(created_view)) { |
| 263 new DevToolsRestorer(this, created_view); | 264 new DevToolsRestorer(this, created_view); |
| 264 return true; | 265 return true; |
| 265 } | 266 } |
| 266 | 267 |
| 267 SendResponse(true); | 268 SendResponse(true); |
| 268 return true; | 269 return true; |
| 269 } | 270 } |
| 270 | 271 |
| 271 } // namespace extensions | 272 } // namespace extensions |
| OLD | NEW |