| 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 <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 191 |
| 192 if (!options->hidden.get() || !*options->hidden) { | 192 if (!options->hidden.get() || !*options->hidden) { |
| 193 if (options->focused.get() && !*options->focused) | 193 if (options->focused.get() && !*options->focused) |
| 194 existing_window->Show(AppWindow::SHOW_INACTIVE); | 194 existing_window->Show(AppWindow::SHOW_INACTIVE); |
| 195 else | 195 else |
| 196 existing_window->Show(AppWindow::SHOW_ACTIVE); | 196 existing_window->Show(AppWindow::SHOW_ACTIVE); |
| 197 } | 197 } |
| 198 | 198 |
| 199 std::unique_ptr<base::DictionaryValue> result( | 199 std::unique_ptr<base::DictionaryValue> result( |
| 200 new base::DictionaryValue); | 200 new base::DictionaryValue); |
| 201 result->Set("frameId", new base::FundamentalValue(frame_id)); | 201 result->Set("frameId", new base::Value(frame_id)); |
| 202 existing_window->GetSerializedState(result.get()); | 202 existing_window->GetSerializedState(result.get()); |
| 203 result->SetBoolean("existingWindow", true); | 203 result->SetBoolean("existingWindow", true); |
| 204 SetResult(std::move(result)); | 204 SetResult(std::move(result)); |
| 205 SendResponse(true); | 205 SendResponse(true); |
| 206 return true; | 206 return true; |
| 207 } | 207 } |
| 208 } | 208 } |
| 209 } | 209 } |
| 210 | 210 |
| 211 if (!GetBoundsSpec(*options, &create_params, &error_)) | 211 if (!GetBoundsSpec(*options, &create_params, &error_)) |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 app_window->ForcedFullscreen(); | 374 app_window->ForcedFullscreen(); |
| 375 } | 375 } |
| 376 | 376 |
| 377 content::RenderFrameHost* created_frame = | 377 content::RenderFrameHost* created_frame = |
| 378 app_window->web_contents()->GetMainFrame(); | 378 app_window->web_contents()->GetMainFrame(); |
| 379 int frame_id = MSG_ROUTING_NONE; | 379 int frame_id = MSG_ROUTING_NONE; |
| 380 if (create_params.creator_process_id == created_frame->GetProcess()->GetID()) | 380 if (create_params.creator_process_id == created_frame->GetProcess()->GetID()) |
| 381 frame_id = created_frame->GetRoutingID(); | 381 frame_id = created_frame->GetRoutingID(); |
| 382 | 382 |
| 383 std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue); | 383 std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue); |
| 384 result->Set("frameId", new base::FundamentalValue(frame_id)); | 384 result->Set("frameId", new base::Value(frame_id)); |
| 385 result->Set("id", new base::StringValue(app_window->window_key())); | 385 result->Set("id", new base::StringValue(app_window->window_key())); |
| 386 app_window->GetSerializedState(result.get()); | 386 app_window->GetSerializedState(result.get()); |
| 387 SetResult(std::move(result)); | 387 SetResult(std::move(result)); |
| 388 | 388 |
| 389 if (AppWindowRegistry::Get(browser_context()) | 389 if (AppWindowRegistry::Get(browser_context()) |
| 390 ->HadDevToolsAttached(app_window->web_contents())) { | 390 ->HadDevToolsAttached(app_window->web_contents())) { |
| 391 AppWindowClient::Get()->OpenDevToolsWindow( | 391 AppWindowClient::Get()->OpenDevToolsWindow( |
| 392 app_window->web_contents(), | 392 app_window->web_contents(), |
| 393 base::Bind(&AppWindowCreateFunction::SendResponse, this, true)); | 393 base::Bind(&AppWindowCreateFunction::SendResponse, this, true)); |
| 394 return true; | 394 return true; |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 | 574 |
| 575 if (options.frame->as_frame_options->inactive_color.get()) { | 575 if (options.frame->as_frame_options->inactive_color.get()) { |
| 576 error_ = app_window_constants::kInactiveColorWithoutColor; | 576 error_ = app_window_constants::kInactiveColorWithoutColor; |
| 577 return false; | 577 return false; |
| 578 } | 578 } |
| 579 | 579 |
| 580 return true; | 580 return true; |
| 581 } | 581 } |
| 582 | 582 |
| 583 } // namespace extensions | 583 } // namespace extensions |
| OLD | NEW |