| 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/extensions/window_controller.h" | 10 #include "chrome/browser/extensions/window_controller.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 create_params.bounds.width() > maximum_size.width()) | 123 create_params.bounds.width() > maximum_size.width()) |
| 124 create_params.bounds.set_width(maximum_size.width()); | 124 create_params.bounds.set_width(maximum_size.width()); |
| 125 if (create_params.bounds.width() < minimum_size.width()) | 125 if (create_params.bounds.width() < minimum_size.width()) |
| 126 create_params.bounds.set_width(minimum_size.width()); | 126 create_params.bounds.set_width(minimum_size.width()); |
| 127 | 127 |
| 128 if (maximum_size.height() && | 128 if (maximum_size.height() && |
| 129 create_params.bounds.height() > maximum_size.height()) | 129 create_params.bounds.height() > maximum_size.height()) |
| 130 create_params.bounds.set_height(maximum_size.height()); | 130 create_params.bounds.set_height(maximum_size.height()); |
| 131 if (create_params.bounds.height() < minimum_size.height()) | 131 if (create_params.bounds.height() < minimum_size.height()) |
| 132 create_params.bounds.set_height(minimum_size.height()); | 132 create_params.bounds.set_height(minimum_size.height()); |
| 133 |
| 134 if (options->hidden.get()) |
| 135 create_params.hidden = *options->hidden.get(); |
| 133 } | 136 } |
| 134 | 137 |
| 135 create_params.creator_process_id = | 138 create_params.creator_process_id = |
| 136 render_view_host_->GetProcess()->GetID(); | 139 render_view_host_->GetProcess()->GetID(); |
| 137 | 140 |
| 138 ShellWindow* shell_window = | 141 ShellWindow* shell_window = |
| 139 ShellWindow::Create(profile(), GetExtension(), url, create_params); | 142 ShellWindow::Create(profile(), GetExtension(), url, create_params); |
| 140 shell_window->GetBaseWindow()->Show(); | |
| 141 | 143 |
| 142 content::RenderViewHost* created_view = | 144 content::RenderViewHost* created_view = |
| 143 shell_window->web_contents()->GetRenderViewHost(); | 145 shell_window->web_contents()->GetRenderViewHost(); |
| 144 int view_id = MSG_ROUTING_NONE; | 146 int view_id = MSG_ROUTING_NONE; |
| 145 if (create_params.creator_process_id == created_view->GetProcess()->GetID()) | 147 if (create_params.creator_process_id == created_view->GetProcess()->GetID()) |
| 146 view_id = created_view->GetRoutingID(); | 148 view_id = created_view->GetRoutingID(); |
| 147 | 149 |
| 148 base::DictionaryValue* result = new base::DictionaryValue; | 150 base::DictionaryValue* result = new base::DictionaryValue; |
| 149 result->Set("viewId", base::Value::CreateIntegerValue(view_id)); | 151 result->Set("viewId", base::Value::CreateIntegerValue(view_id)); |
| 150 result->Set("injectTitlebar", | 152 result->Set("injectTitlebar", |
| 151 base::Value::CreateBooleanValue(inject_html_titlebar)); | 153 base::Value::CreateBooleanValue(inject_html_titlebar)); |
| 152 result->Set("id", base::Value::CreateStringValue(shell_window->window_key())); | 154 result->Set("id", base::Value::CreateStringValue(shell_window->window_key())); |
| 153 SetResult(result); | 155 SetResult(result); |
| 154 return true; | 156 return true; |
| 155 } | 157 } |
| 156 | 158 |
| 157 } // namespace extensions | 159 } // namespace extensions |
| OLD | NEW |