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

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

Issue 547593002: Add ShellAppsClient, ShellAppDelegate, ShellNativeAppWindow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@apifeatures
Patch Set: Add missing virtual Created 6 years, 3 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
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_desktop_controller.h" 5 #include "extensions/shell/browser/shell_desktop_controller.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "extensions/shell/browser/shell_app_window.h" 8 #include "extensions/shell/browser/shell_app_window.h"
9 #include "extensions/shell/common/switches.h" 9 #include "extensions/shell/common/switches.h"
10 #include "ui/aura/client/cursor_client.h" 10 #include "ui/aura/client/cursor_client.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 ShellAppWindow* ShellDesktopController::CreateAppWindow( 182 ShellAppWindow* ShellDesktopController::CreateAppWindow(
183 content::BrowserContext* context, 183 content::BrowserContext* context,
184 const Extension* extension) { 184 const Extension* extension) {
185 aura::Window* root_window = GetHost()->window(); 185 aura::Window* root_window = GetHost()->window();
186 186
187 app_window_.reset(new ShellAppWindow); 187 app_window_.reset(new ShellAppWindow);
188 app_window_->Init(context, extension, root_window->bounds().size()); 188 app_window_->Init(context, extension, root_window->bounds().size());
189 189
190 // Attach the web contents view to our window hierarchy. 190 // Attach the web contents view to our window hierarchy.
191 aura::Window* content = app_window_->GetNativeWindow(); 191 aura::Window* content = app_window_->GetNativeWindow();
192 root_window->AddChild(content); 192 AddAppWindow(content);
193 content->Show(); 193 content->Show();
194 194
195 return app_window_.get(); 195 return app_window_.get();
196 } 196 }
197 197
198 void ShellDesktopController::AddAppWindow(aura::Window* window) {
199 aura::Window* root_window = GetHost()->window();
200 root_window->AddChild(window);
201 }
202
198 void ShellDesktopController::CloseAppWindows() { 203 void ShellDesktopController::CloseAppWindows() {
199 app_window_.reset(); 204 app_window_.reset();
200 } 205 }
201 206
202 aura::Window* ShellDesktopController::GetDefaultParent( 207 aura::Window* ShellDesktopController::GetDefaultParent(
203 aura::Window* context, 208 aura::Window* context,
204 aura::Window* window, 209 aura::Window* window,
205 const gfx::Rect& bounds) { 210 const gfx::Rect& bounds) {
206 return host_->window(); 211 return host_->window();
207 } 212 }
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 if (displays.empty()) 340 if (displays.empty())
336 return gfx::Size(); 341 return gfx::Size();
337 const ui::DisplayMode* mode = displays[0].display->current_mode(); 342 const ui::DisplayMode* mode = displays[0].display->current_mode();
338 return mode ? mode->size() : gfx::Size(); 343 return mode ? mode->size() : gfx::Size();
339 #else 344 #else
340 return gfx::Size(); 345 return gfx::Size();
341 #endif 346 #endif
342 } 347 }
343 348
344 } // namespace extensions 349 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/shell/browser/shell_desktop_controller.h ('k') | extensions/shell/browser/shell_native_app_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698