Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Side by Side Diff: extensions/browser/api/app_window/app_window_api.cc

Issue 958923004: Fix hiding behavior when creating app windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove changes to platform_apps/hidden/test.js Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/test/data/extensions/platform_apps/hidden_with_id/test.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/platform_apps/hidden_with_id/test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698