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.h" | 7 #include "apps/app_window.h" |
8 #include "apps/app_window_contents.h" | 8 #include "apps/app_window_contents.h" |
9 #include "apps/app_window_registry.h" | 9 #include "apps/app_window_registry.h" |
10 #include "apps/apps_client.h" | 10 #include "apps/apps_client.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 extension_id(), create_params.window_key); | 194 extension_id(), create_params.window_key); |
195 if (window) { | 195 if (window) { |
196 content::RenderViewHost* created_view = | 196 content::RenderViewHost* created_view = |
197 window->web_contents()->GetRenderViewHost(); | 197 window->web_contents()->GetRenderViewHost(); |
198 int view_id = MSG_ROUTING_NONE; | 198 int view_id = MSG_ROUTING_NONE; |
199 if (render_view_host_->GetProcess()->GetID() == | 199 if (render_view_host_->GetProcess()->GetID() == |
200 created_view->GetProcess()->GetID()) { | 200 created_view->GetProcess()->GetID()) { |
201 view_id = created_view->GetRoutingID(); | 201 view_id = created_view->GetRoutingID(); |
202 } | 202 } |
203 | 203 |
204 if (options->focused.get() && !*options->focused.get()) | 204 if (options->hidden.get() && !*options->hidden.get()) { |
205 window->Show(AppWindow::SHOW_INACTIVE); | 205 if (options->focused.get() && !*options->focused.get()) |
206 else | 206 window->Show(AppWindow::SHOW_INACTIVE); |
207 window->Show(AppWindow::SHOW_ACTIVE); | 207 else |
| 208 window->Show(AppWindow::SHOW_ACTIVE); |
| 209 } |
208 | 210 |
209 base::DictionaryValue* result = new base::DictionaryValue; | 211 base::DictionaryValue* result = new base::DictionaryValue; |
210 result->Set("viewId", new base::FundamentalValue(view_id)); | 212 result->Set("viewId", new base::FundamentalValue(view_id)); |
211 window->GetSerializedState(result); | 213 window->GetSerializedState(result); |
212 result->SetBoolean("existingWindow", true); | 214 result->SetBoolean("existingWindow", true); |
213 // TODO(benwells): Remove HTML titlebar injection. | 215 // TODO(benwells): Remove HTML titlebar injection. |
214 result->SetBoolean("injectTitlebar", false); | 216 result->SetBoolean("injectTitlebar", false); |
215 SetResult(result); | 217 SetResult(result); |
216 SendResponse(true); | 218 SendResponse(true); |
217 return true; | 219 return true; |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 | 492 |
491 if (options.frame->as_frame_options->inactive_color.get()) { | 493 if (options.frame->as_frame_options->inactive_color.get()) { |
492 error_ = app_window_constants::kInactiveColorWithoutColor; | 494 error_ = app_window_constants::kInactiveColorWithoutColor; |
493 return false; | 495 return false; |
494 } | 496 } |
495 | 497 |
496 return true; | 498 return true; |
497 } | 499 } |
498 | 500 |
499 } // namespace extensions | 501 } // namespace extensions |
OLD | NEW |