blob: ccfa1f61d54d30b5432b7fdc7bc8e20a3e7fb3f6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#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 {
// static
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;
}
} // namespace content
|