This source file includes following definitions.
- PlatformInitialize
- PlatformExit
- PlatformCleanUp
- PlatformEnableUIControl
- PlatformSetAddressBarURL
- PlatformSetIsLoading
- PlatformCreateWindow
- PlatformSetContents
- PlatformResizeSubViews
- Close
- PlatformSetTitle
- PlatformHandleContextMenu
#include "content/shell/browser/shell.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
#include "content/shell/browser/shell_platform_data_aura.h"
#include "ui/aura/env.h"
#include "ui/aura/test/test_screen.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
namespace content {
void Shell::PlatformInitialize(const gfx::Size& default_window_size) {
CHECK(!platform_);
aura::TestScreen* screen = aura::TestScreen::Create();
gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen);
platform_ = new ShellPlatformDataAura(default_window_size);
}
void Shell::PlatformExit() {
CHECK(platform_);
delete platform_;
platform_ = NULL;
aura::Env::DeleteInstance();
}
void Shell::PlatformCleanUp() {
}
void Shell::PlatformEnableUIControl(UIControl control, bool is_enabled) {
}
void Shell::PlatformSetAddressBarURL(const GURL& url) {
}
void Shell::PlatformSetIsLoading(bool loading) {
}
void Shell::PlatformCreateWindow(int width, int height) {
CHECK(platform_);
if (!headless_)
platform_->ShowWindow();
platform_->ResizeWindow(gfx::Size(width, height));
}
void Shell::PlatformSetContents() {
CHECK(platform_);
aura::Window* content = web_contents_->GetView()->GetNativeView();
aura::Window* parent = platform_->host()->window();
if (parent->Contains(content))
return;
parent->AddChild(content);
content->Show();
}
void Shell::PlatformResizeSubViews() {
}
void Shell::Close() {
delete this;
}
void Shell::PlatformSetTitle(const base::string16& title) {
}
bool Shell::PlatformHandleContextMenu(
const content::ContextMenuParams& params) {
return false;
}
}