| 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/debugger/devtools_window.h" | 10 #include "chrome/browser/debugger/devtools_window.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 if (options->left.get() || options->top.get()) { | 133 if (options->left.get() || options->top.get()) { |
| 134 if (options->left.get()) | 134 if (options->left.get()) |
| 135 create_params.bounds.set_x(*options->left.get()); | 135 create_params.bounds.set_x(*options->left.get()); |
| 136 if (options->top.get()) | 136 if (options->top.get()) |
| 137 create_params.bounds.set_y(*options->top.get()); | 137 create_params.bounds.set_y(*options->top.get()); |
| 138 create_params.restore_position = false; | 138 create_params.restore_position = false; |
| 139 } | 139 } |
| 140 | 140 |
| 141 if (options->frame.get()) { | 141 if (options->frame.get()) { |
| 142 if (*options->frame == kHtmlFrameOption && | 142 if (*options->frame == kHtmlFrameOption && |
| 143 CommandLine::ForCurrentProcess()->HasSwitch( | 143 GetExtension()->HasAPIPermission(APIPermission::kExperimental)) { |
| 144 switches::kEnableExperimentalExtensionApis)) { | |
| 145 create_params.frame = ShellWindow::CreateParams::FRAME_NONE; | 144 create_params.frame = ShellWindow::CreateParams::FRAME_NONE; |
| 146 inject_html_titlebar = true; | 145 inject_html_titlebar = true; |
| 147 } else if (*options->frame == kNoneFrameOption) { | 146 } else if (*options->frame == kNoneFrameOption) { |
| 148 create_params.frame = ShellWindow::CreateParams::FRAME_NONE; | 147 create_params.frame = ShellWindow::CreateParams::FRAME_NONE; |
| 149 } else { | 148 } else { |
| 150 create_params.frame = ShellWindow::CreateParams::FRAME_CHROME; | 149 create_params.frame = ShellWindow::CreateParams::FRAME_CHROME; |
| 151 } | 150 } |
| 152 } | 151 } |
| 153 | 152 |
| 153 if (options->transparent_background.get() && |
| 154 GetExtension()->HasAPIPermission(APIPermission::kExperimental)) { |
| 155 create_params.transparent_background = *options->transparent_background; |
| 156 } |
| 157 |
| 154 gfx::Size& minimum_size = create_params.minimum_size; | 158 gfx::Size& minimum_size = create_params.minimum_size; |
| 155 if (options->min_width.get()) | 159 if (options->min_width.get()) |
| 156 minimum_size.set_width(*options->min_width); | 160 minimum_size.set_width(*options->min_width); |
| 157 if (options->min_height.get()) | 161 if (options->min_height.get()) |
| 158 minimum_size.set_height(*options->min_height); | 162 minimum_size.set_height(*options->min_height); |
| 159 gfx::Size& maximum_size = create_params.maximum_size; | 163 gfx::Size& maximum_size = create_params.maximum_size; |
| 160 if (options->max_width.get()) | 164 if (options->max_width.get()) |
| 161 maximum_size.set_width(*options->max_width); | 165 maximum_size.set_width(*options->max_width); |
| 162 if (options->max_height.get()) | 166 if (options->max_height.get()) |
| 163 maximum_size.set_height(*options->max_height); | 167 maximum_size.set_height(*options->max_height); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 if (ShellWindowRegistry::Get(profile())->HadDevToolsAttached(created_view)) { | 212 if (ShellWindowRegistry::Get(profile())->HadDevToolsAttached(created_view)) { |
| 209 new DevToolsRestorer(this, created_view); | 213 new DevToolsRestorer(this, created_view); |
| 210 return true; | 214 return true; |
| 211 } | 215 } |
| 212 | 216 |
| 213 SendResponse(true); | 217 SendResponse(true); |
| 214 return true; | 218 return true; |
| 215 } | 219 } |
| 216 | 220 |
| 217 } // namespace extensions | 221 } // namespace extensions |
| OLD | NEW |