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 "extensions/browser/api/app_window/app_window_api.h" | 5 #include "extensions/browser/api/app_window/app_window_api.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 extension_id(), create_params.window_key); | 175 extension_id(), create_params.window_key); |
176 if (window) { | 176 if (window) { |
177 content::RenderViewHost* created_view = | 177 content::RenderViewHost* created_view = |
178 window->web_contents()->GetRenderViewHost(); | 178 window->web_contents()->GetRenderViewHost(); |
179 int view_id = MSG_ROUTING_NONE; | 179 int view_id = MSG_ROUTING_NONE; |
180 if (render_view_host_->GetProcess()->GetID() == | 180 if (render_view_host_->GetProcess()->GetID() == |
181 created_view->GetProcess()->GetID()) { | 181 created_view->GetProcess()->GetID()) { |
182 view_id = created_view->GetRoutingID(); | 182 view_id = created_view->GetRoutingID(); |
183 } | 183 } |
184 | 184 |
185 if (options->hidden.get() && !*options->hidden.get()) { | 185 if (!options->hidden.get() || !*options->hidden.get()) { |
186 if (options->focused.get() && !*options->focused.get()) | 186 if (options->focused.get() && !*options->focused.get()) |
187 window->Show(AppWindow::SHOW_INACTIVE); | 187 window->Show(AppWindow::SHOW_INACTIVE); |
188 else | 188 else |
189 window->Show(AppWindow::SHOW_ACTIVE); | 189 window->Show(AppWindow::SHOW_ACTIVE); |
190 } | 190 } |
191 | 191 |
192 base::DictionaryValue* result = new base::DictionaryValue; | 192 base::DictionaryValue* result = new base::DictionaryValue; |
193 result->Set("viewId", new base::FundamentalValue(view_id)); | 193 result->Set("viewId", new base::FundamentalValue(view_id)); |
194 window->GetSerializedState(result); | 194 window->GetSerializedState(result); |
195 result->SetBoolean("existingWindow", true); | 195 result->SetBoolean("existingWindow", true); |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 | 543 |
544 if (options.frame->as_frame_options->inactive_color.get()) { | 544 if (options.frame->as_frame_options->inactive_color.get()) { |
545 error_ = app_window_constants::kInactiveColorWithoutColor; | 545 error_ = app_window_constants::kInactiveColorWithoutColor; |
546 return false; | 546 return false; |
547 } | 547 } |
548 | 548 |
549 return true; | 549 return true; |
550 } | 550 } |
551 | 551 |
552 } // namespace extensions | 552 } // namespace extensions |
OLD | NEW |