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

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

Issue 166833004: Add support for chrome.app.window.create() to app_shell (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase (shell_app_window) Created 6 years, 10 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/ui/native_app_window.h" 11 #include "apps/ui/native_app_window.h"
11 #include "base/command_line.h" 12 #include "base/command_line.h"
12 #include "base/strings/string_number_conversions.h" 13 #include "base/strings/string_number_conversions.h"
13 #include "base/time/time.h" 14 #include "base/time/time.h"
14 #include "base/values.h" 15 #include "base/values.h"
15 #include "chrome/browser/app_mode/app_mode_utils.h" 16 #include "chrome/browser/app_mode/app_mode_utils.h"
16 #include "chrome/browser/devtools/devtools_window.h" 17 #include "chrome/browser/devtools/devtools_window.h"
17 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" 18 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h"
18 #include "chrome/browser/extensions/window_controller.h" 19 #include "chrome/browser/extensions/window_controller.h"
19 #include "chrome/browser/profiles/profile.h" 20 #include "chrome/browser/profiles/profile.h"
20 #include "chrome/browser/ui/apps/chrome_app_window_delegate.h"
21 #include "chrome/common/extensions/api/app_window.h" 21 #include "chrome/common/extensions/api/app_window.h"
22 #include "chrome/common/extensions/features/feature_channel.h" 22 #include "chrome/common/extensions/features/feature_channel.h"
23 #include "content/public/browser/notification_registrar.h" 23 #include "content/public/browser/notification_registrar.h"
24 #include "content/public/browser/notification_types.h" 24 #include "content/public/browser/notification_types.h"
25 #include "content/public/browser/render_process_host.h" 25 #include "content/public/browser/render_process_host.h"
26 #include "content/public/browser/render_view_host.h" 26 #include "content/public/browser/render_view_host.h"
27 #include "content/public/browser/web_contents.h" 27 #include "content/public/browser/web_contents.h"
28 #include "content/public/common/url_constants.h" 28 #include "content/public/common/url_constants.h"
29 #include "extensions/browser/extensions_browser_client.h" 29 #include "extensions/browser/extensions_browser_client.h"
30 #include "extensions/common/switches.h" 30 #include "extensions/common/switches.h"
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 break; 262 break;
263 } 263 }
264 } 264 }
265 } 265 }
266 266
267 UpdateFrameOptionsForChannel(&create_params); 267 UpdateFrameOptionsForChannel(&create_params);
268 268
269 create_params.creator_process_id = 269 create_params.creator_process_id =
270 render_view_host_->GetProcess()->GetID(); 270 render_view_host_->GetProcess()->GetID();
271 271
272 AppWindow* app_window = new AppWindow( 272 AppWindow* app_window =
273 GetProfile(), new ChromeAppWindowDelegate(), GetExtension()); 273 apps::AppsClient::Get()->CreateAppWindow(GetProfile(), GetExtension());
274 app_window->Init( 274 app_window->Init(
275 url, new apps::AppWindowContentsImpl(app_window), create_params); 275 url, new apps::AppWindowContentsImpl(app_window), create_params);
276 276
277 if (chrome::IsRunningInForcedAppMode()) 277 if (chrome::IsRunningInForcedAppMode())
278 app_window->ForcedFullscreen(); 278 app_window->ForcedFullscreen();
279 279
280 content::RenderViewHost* created_view = 280 content::RenderViewHost* created_view =
281 app_window->web_contents()->GetRenderViewHost(); 281 app_window->web_contents()->GetRenderViewHost();
282 int view_id = MSG_ROUTING_NONE; 282 int view_id = MSG_ROUTING_NONE;
283 if (create_params.creator_process_id == created_view->GetProcess()->GetID()) 283 if (create_params.creator_process_id == created_view->GetProcess()->GetID())
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 GetCurrentChannel() > chrome::VersionInfo::CHANNEL_DEV) { 365 GetCurrentChannel() > chrome::VersionInfo::CHANNEL_DEV) {
366 // If not on trunk or dev channel, always use the standard white frame. 366 // If not on trunk or dev channel, always use the standard white frame.
367 // TODO(benwells): Remove this code once we get agreement to use the new 367 // TODO(benwells): Remove this code once we get agreement to use the new
368 // native style frame. 368 // native style frame.
369 create_params->has_frame_color = true; 369 create_params->has_frame_color = true;
370 create_params->frame_color = SK_ColorWHITE; 370 create_params->frame_color = SK_ColorWHITE;
371 } 371 }
372 } 372 }
373 373
374 } // namespace extensions 374 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698