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

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

Issue 21344002: Move native_app_window code to apps areas (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to after mac app shim fix Created 7 years, 4 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_contents.h" 7 #include "apps/app_window_contents.h"
8 #include "apps/native_app_window.h"
8 #include "apps/shell_window.h" 9 #include "apps/shell_window.h"
9 #include "base/command_line.h" 10 #include "base/command_line.h"
10 #include "base/time/time.h" 11 #include "base/time/time.h"
11 #include "base/values.h" 12 #include "base/values.h"
12 #include "chrome/browser/app_mode/app_mode_utils.h" 13 #include "chrome/browser/app_mode/app_mode_utils.h"
13 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
14 #include "chrome/browser/devtools/devtools_window.h" 15 #include "chrome/browser/devtools/devtools_window.h"
15 #include "chrome/browser/extensions/shell_window_registry.h" 16 #include "chrome/browser/extensions/shell_window_registry.h"
16 #include "chrome/browser/extensions/window_controller.h" 17 #include "chrome/browser/extensions/window_controller.h"
17 #include "chrome/browser/ui/apps/chrome_shell_window_delegate.h" 18 #include "chrome/browser/ui/apps/chrome_shell_window_delegate.h"
18 #include "chrome/browser/ui/extensions/native_app_window.h"
19 #include "chrome/common/extensions/api/app_window.h" 19 #include "chrome/common/extensions/api/app_window.h"
20 #include "chrome/common/extensions/features/feature.h" 20 #include "chrome/common/extensions/features/feature.h"
21 #include "content/public/browser/notification_registrar.h" 21 #include "content/public/browser/notification_registrar.h"
22 #include "content/public/browser/notification_types.h" 22 #include "content/public/browser/notification_types.h"
23 #include "content/public/browser/render_process_host.h" 23 #include "content/public/browser/render_process_host.h"
24 #include "content/public/browser/render_view_host.h" 24 #include "content/public/browser/render_view_host.h"
25 #include "content/public/browser/web_contents.h" 25 #include "content/public/browser/web_contents.h"
26 #include "content/public/common/url_constants.h" 26 #include "content/public/common/url_constants.h"
27 #include "extensions/common/switches.h" 27 #include "extensions/common/switches.h"
28 #include "ui/base/ui_base_types.h" 28 #include "ui/base/ui_base_types.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 gfx::Size size = ash::Shell::GetPrimaryRootWindow()->bounds().size(); 287 gfx::Size size = ash::Shell::GetPrimaryRootWindow()->bounds().size();
288 if (size.width() > create_params.maximum_size.width() || 288 if (size.width() > create_params.maximum_size.width() ||
289 size.height() > create_params.maximum_size.height()) 289 size.height() > create_params.maximum_size.height())
290 force_maximize = false; 290 force_maximize = false;
291 } 291 }
292 #endif 292 #endif
293 293
294 if (force_maximize) 294 if (force_maximize)
295 create_params.state = ui::SHOW_STATE_MAXIMIZED; 295 create_params.state = ui::SHOW_STATE_MAXIMIZED;
296 296
297 ShellWindow* shell_window = new ShellWindow( 297 ShellWindow* shell_window = new ShellWindow(profile(),
298 profile(), 298 new ChromeShellWindowDelegate(),
299 new chrome::ChromeShellWindowDelegate(), 299 GetExtension());
300 GetExtension());
301 shell_window->Init(url, 300 shell_window->Init(url,
302 new apps::AppWindowContents(shell_window), 301 new apps::AppWindowContents(shell_window),
303 create_params); 302 create_params);
304 303
305 if (chrome::IsRunningInForcedAppMode()) 304 if (chrome::IsRunningInForcedAppMode())
306 shell_window->Fullscreen(); 305 shell_window->Fullscreen();
307 306
308 content::RenderViewHost* created_view = 307 content::RenderViewHost* created_view =
309 shell_window->web_contents()->GetRenderViewHost(); 308 shell_window->web_contents()->GetRenderViewHost();
310 int view_id = MSG_ROUTING_NONE; 309 int view_id = MSG_ROUTING_NONE;
(...skipping 11 matching lines...) Expand all
322 if (ShellWindowRegistry::Get(profile())->HadDevToolsAttached(created_view)) { 321 if (ShellWindowRegistry::Get(profile())->HadDevToolsAttached(created_view)) {
323 new DevToolsRestorer(this, created_view); 322 new DevToolsRestorer(this, created_view);
324 return true; 323 return true;
325 } 324 }
326 325
327 SendResponse(true); 326 SendResponse(true);
328 return true; 327 return true;
329 } 328 }
330 329
331 } // namespace extensions 330 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698