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

Side by Side Diff: extensions/shell/browser/shell_app_window_client.cc

Issue 696063008: Refactor ShellDesktopController and ShellNativeAppWindow to allow for non-aura implementations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/shell/browser/shell_app_window_client.h" 5 #include "extensions/shell/browser/shell_app_window_client.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "extensions/browser/app_window/app_window.h" 9 #include "extensions/browser/app_window/app_window.h"
10 #include "extensions/shell/browser/desktop_controller.h" 10 #include "extensions/shell/browser/desktop_controller.h"
11 #include "extensions/shell/browser/shell_native_app_window.h" 11
12 #if defined(USE_AURA)
13 #include "extensions/shell/browser/shell_native_app_window_aura.h"
14 #endif
12 15
13 namespace extensions { 16 namespace extensions {
14 17
15 ShellAppWindowClient::ShellAppWindowClient() { 18 ShellAppWindowClient::ShellAppWindowClient() {
16 } 19 }
17 20
18 ShellAppWindowClient::~ShellAppWindowClient() { 21 ShellAppWindowClient::~ShellAppWindowClient() {
19 } 22 }
20 23
21 AppWindow* ShellAppWindowClient::CreateAppWindow( 24 AppWindow* ShellAppWindowClient::CreateAppWindow(
22 content::BrowserContext* context, 25 content::BrowserContext* context,
23 const Extension* extension) { 26 const Extension* extension) {
24 return DesktopController::instance()->CreateAppWindow(context, extension); 27 return DesktopController::instance()->CreateAppWindow(context, extension);
25 } 28 }
26 29
30 #if defined(USE_AURA)
James Cook 2014/11/11 18:23:52 Are you sure you want to ifdef out the whole funct
Yoyo Zhou 2014/11/15 01:05:44 Yes, this is confusing: I can't include Obj-C from
James Cook 2014/11/17 17:48:36 I don't understand. Are you saying you would creat
Yoyo Zhou 2014/11/17 19:35:55 In my mac build, I have a shell_app_window_client_
James Cook 2014/11/17 20:54:22 I think separate files is best practice. You coul
Yoyo Zhou 2014/11/17 23:55:26 I moved this function to a separate file.
27 NativeAppWindow* ShellAppWindowClient::CreateNativeAppWindow( 31 NativeAppWindow* ShellAppWindowClient::CreateNativeAppWindow(
28 AppWindow* window, 32 AppWindow* window,
29 AppWindow::CreateParams* params) { 33 AppWindow::CreateParams* params) {
30 ShellNativeAppWindow* native_app_window = 34 ShellNativeAppWindow* native_app_window =
31 new ShellNativeAppWindow(window, *params); 35 new ShellNativeAppWindowAura(window, *params);
32 DesktopController::instance()->AddAppWindow( 36 DesktopController::instance()->AddAppWindow(
33 native_app_window->GetNativeWindow()); 37 native_app_window->GetNativeWindow());
34 return native_app_window; 38 return native_app_window;
35 } 39 }
40 #endif // USE_AURA
36 41
37 void ShellAppWindowClient::OpenDevToolsWindow( 42 void ShellAppWindowClient::OpenDevToolsWindow(
38 content::WebContents* web_contents, 43 content::WebContents* web_contents,
39 const base::Closure& callback) { 44 const base::Closure& callback) {
40 NOTIMPLEMENTED(); 45 NOTIMPLEMENTED();
41 } 46 }
42 47
43 bool ShellAppWindowClient::IsCurrentChannelOlderThanDev() { 48 bool ShellAppWindowClient::IsCurrentChannelOlderThanDev() {
44 return false; 49 return false;
45 } 50 }
46 51
47 } // namespace extensions 52 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698