| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/shell/browser/shell.h" | 5 #include "content/shell/browser/shell.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
| 10 #include "content/public/browser/web_contents_view.h" | 10 #include "content/public/browser/web_contents_view.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "ui/views/layout/grid_layout.h" | 24 #include "ui/views/layout/grid_layout.h" |
| 25 #include "ui/views/test/desktop_test_views_delegate.h" | 25 #include "ui/views/test/desktop_test_views_delegate.h" |
| 26 #include "ui/views/view.h" | 26 #include "ui/views/view.h" |
| 27 #include "ui/views/widget/desktop_aura/desktop_screen.h" | 27 #include "ui/views/widget/desktop_aura/desktop_screen.h" |
| 28 #include "ui/views/widget/widget.h" | 28 #include "ui/views/widget/widget.h" |
| 29 #include "ui/views/widget/widget_delegate.h" | 29 #include "ui/views/widget/widget_delegate.h" |
| 30 | 30 |
| 31 #if defined(OS_CHROMEOS) | 31 #if defined(OS_CHROMEOS) |
| 32 #include "chromeos/dbus/dbus_thread_manager.h" | 32 #include "chromeos/dbus/dbus_thread_manager.h" |
| 33 #include "ui/aura/test/test_screen.h" | 33 #include "ui/aura/test/test_screen.h" |
| 34 #include "ui/shell/minimal_shell.h" | 34 #include "ui/wm/test/minimal_shell.h" |
| 35 #endif | 35 #endif |
| 36 | 36 |
| 37 #if defined(OS_WIN) | 37 #if defined(OS_WIN) |
| 38 #include <fcntl.h> | 38 #include <fcntl.h> |
| 39 #include <io.h> | 39 #include <io.h> |
| 40 #endif | 40 #endif |
| 41 | 41 |
| 42 namespace content { | 42 namespace content { |
| 43 | 43 |
| 44 namespace { | 44 namespace { |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 // Contents view contains the web contents view | 285 // Contents view contains the web contents view |
| 286 View* contents_view_; | 286 View* contents_view_; |
| 287 views::WebView* web_view_; | 287 views::WebView* web_view_; |
| 288 | 288 |
| 289 DISALLOW_COPY_AND_ASSIGN(ShellWindowDelegateView); | 289 DISALLOW_COPY_AND_ASSIGN(ShellWindowDelegateView); |
| 290 }; | 290 }; |
| 291 | 291 |
| 292 } // namespace | 292 } // namespace |
| 293 | 293 |
| 294 #if defined(OS_CHROMEOS) | 294 #if defined(OS_CHROMEOS) |
| 295 shell::MinimalShell* Shell::minimal_shell_ = NULL; | 295 wm::MinimalShell* Shell::minimal_shell_ = NULL; |
| 296 #endif | 296 #endif |
| 297 views::ViewsDelegate* Shell::views_delegate_ = NULL; | 297 views::ViewsDelegate* Shell::views_delegate_ = NULL; |
| 298 | 298 |
| 299 // static | 299 // static |
| 300 void Shell::PlatformInitialize(const gfx::Size& default_window_size) { | 300 void Shell::PlatformInitialize(const gfx::Size& default_window_size) { |
| 301 #if defined(OS_WIN) | 301 #if defined(OS_WIN) |
| 302 _setmode(_fileno(stdout), _O_BINARY); | 302 _setmode(_fileno(stdout), _O_BINARY); |
| 303 _setmode(_fileno(stderr), _O_BINARY); | 303 _setmode(_fileno(stderr), _O_BINARY); |
| 304 #endif | 304 #endif |
| 305 #if defined(OS_CHROMEOS) | 305 #if defined(OS_CHROMEOS) |
| 306 chromeos::DBusThreadManager::Initialize(); | 306 chromeos::DBusThreadManager::Initialize(); |
| 307 gfx::Screen::SetScreenInstance( | 307 gfx::Screen::SetScreenInstance( |
| 308 gfx::SCREEN_TYPE_NATIVE, aura::TestScreen::Create()); | 308 gfx::SCREEN_TYPE_NATIVE, aura::TestScreen::Create()); |
| 309 minimal_shell_ = new shell::MinimalShell(default_window_size); | 309 minimal_shell_ = new wm::MinimalShell(default_window_size); |
| 310 #else | 310 #else |
| 311 gfx::Screen::SetScreenInstance( | 311 gfx::Screen::SetScreenInstance( |
| 312 gfx::SCREEN_TYPE_NATIVE, views::CreateDesktopScreen()); | 312 gfx::SCREEN_TYPE_NATIVE, views::CreateDesktopScreen()); |
| 313 #endif | 313 #endif |
| 314 views_delegate_ = new ShellViewsDelegateAura(); | 314 views_delegate_ = new ShellViewsDelegateAura(); |
| 315 } | 315 } |
| 316 | 316 |
| 317 void Shell::PlatformExit() { | 317 void Shell::PlatformExit() { |
| 318 std::vector<Shell*> windows = windows_; | 318 std::vector<Shell*> windows = windows_; |
| 319 for (std::vector<Shell*>::iterator it = windows.begin(); | 319 for (std::vector<Shell*>::iterator it = windows.begin(); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 } | 393 } |
| 394 | 394 |
| 395 void Shell::PlatformSetTitle(const string16& title) { | 395 void Shell::PlatformSetTitle(const string16& title) { |
| 396 ShellWindowDelegateView* delegate_view = | 396 ShellWindowDelegateView* delegate_view = |
| 397 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); | 397 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); |
| 398 delegate_view->SetWindowTitle(title); | 398 delegate_view->SetWindowTitle(title); |
| 399 window_widget_->UpdateWindowTitle(); | 399 window_widget_->UpdateWindowTitle(); |
| 400 } | 400 } |
| 401 | 401 |
| 402 } // namespace content | 402 } // namespace content |
| OLD | NEW |