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

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

Issue 378193002: AppWindowContents: Clean up unnecessary SuspendRenderViewHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove even more unused includes. Created 6 years, 5 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 | Annotate | Revision Log
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 "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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 case extensions::api::app_window::STATE_MAXIMIZED: 271 case extensions::api::app_window::STATE_MAXIMIZED:
272 create_params.state = ui::SHOW_STATE_MAXIMIZED; 272 create_params.state = ui::SHOW_STATE_MAXIMIZED;
273 break; 273 break;
274 case extensions::api::app_window::STATE_MINIMIZED: 274 case extensions::api::app_window::STATE_MINIMIZED:
275 create_params.state = ui::SHOW_STATE_MINIMIZED; 275 create_params.state = ui::SHOW_STATE_MINIMIZED;
276 break; 276 break;
277 } 277 }
278 } 278 }
279 } 279 }
280 280
281 create_params.creator_process_id =
282 render_view_host_->GetProcess()->GetID();
283
284 AppWindow* app_window = apps::AppsClient::Get()->CreateAppWindow( 281 AppWindow* app_window = apps::AppsClient::Get()->CreateAppWindow(
285 browser_context(), GetExtension()); 282 browser_context(), GetExtension());
286 app_window->Init( 283 app_window->Init(
287 url, new apps::AppWindowContentsImpl(app_window), create_params); 284 url, new apps::AppWindowContentsImpl(app_window), create_params);
288 285
289 if (ExtensionsBrowserClient::Get()->IsRunningInForcedAppMode()) 286 if (ExtensionsBrowserClient::Get()->IsRunningInForcedAppMode())
290 app_window->ForcedFullscreen(); 287 app_window->ForcedFullscreen();
291 288
292 content::RenderViewHost* created_view = 289 content::RenderViewHost* created_view =
293 app_window->web_contents()->GetRenderViewHost(); 290 app_window->web_contents()->GetRenderViewHost();
294 int view_id = MSG_ROUTING_NONE; 291 int view_id = MSG_ROUTING_NONE;
295 if (create_params.creator_process_id == created_view->GetProcess()->GetID()) 292 if (render_view_host_->GetProcess()->GetID() ==
293 created_view->GetProcess()->GetID())
not at google - send to devlin 2014/07/09 13:48:50 nit: body should have {} since condition is 2 line
Matt Giuca 2014/07/10 03:37:06 I'm not sure about the DCHECK vs if. I'll leave it
scheib 2014/07/10 16:53:11 An if or a CHECK I think --- if we just use a DCHE
not at google - send to devlin 2014/07/10 17:03:10 yeah, I think an if is fine.
Matt Giuca 2014/07/11 00:15:49 So I'll leave this as-is.
296 view_id = created_view->GetRoutingID(); 294 view_id = created_view->GetRoutingID();
297 295
298 base::DictionaryValue* result = new base::DictionaryValue; 296 base::DictionaryValue* result = new base::DictionaryValue;
299 result->Set("viewId", new base::FundamentalValue(view_id)); 297 result->Set("viewId", new base::FundamentalValue(view_id));
300 result->Set("injectTitlebar", 298 result->Set("injectTitlebar",
301 new base::FundamentalValue(inject_html_titlebar_)); 299 new base::FundamentalValue(inject_html_titlebar_));
302 result->Set("id", new base::StringValue(app_window->window_key())); 300 result->Set("id", new base::StringValue(app_window->window_key()));
303 app_window->GetSerializedState(result); 301 app_window->GetSerializedState(result);
304 SetResult(result); 302 SetResult(result);
305 303
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 488
491 if (options.frame->as_frame_options->inactive_color.get()) { 489 if (options.frame->as_frame_options->inactive_color.get()) {
492 error_ = app_window_constants::kInactiveColorWithoutColor; 490 error_ = app_window_constants::kInactiveColorWithoutColor;
493 return false; 491 return false;
494 } 492 }
495 493
496 return true; 494 return true;
497 } 495 }
498 496
499 } // namespace extensions 497 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698