Fix compilation errors and warnings on native_window.cc.
This commit is contained in:
parent
6bdf7c51b4
commit
1b93ec1032
1 changed files with 6 additions and 5 deletions
|
@ -65,7 +65,8 @@ NativeWindow* NativeWindow::Create(base::DictionaryValue* options) {
|
||||||
NativeWindow* NativeWindow::FromRenderView(int process_id, int routing_id) {
|
NativeWindow* NativeWindow::FromRenderView(int process_id, int routing_id) {
|
||||||
// Stupid iterating.
|
// Stupid iterating.
|
||||||
WindowList& window_list = *WindowList::GetInstance();
|
WindowList& window_list = *WindowList::GetInstance();
|
||||||
for (auto window : window_list) {
|
for (auto w = window_list.begin(); w != window_list.end(); ++w) {
|
||||||
|
auto& window = *w;
|
||||||
content::WebContents* web_contents = window->GetWebContents();
|
content::WebContents* web_contents = window->GetWebContents();
|
||||||
int window_process_id = web_contents->GetRenderProcessHost()->GetID();
|
int window_process_id = web_contents->GetRenderProcessHost()->GetID();
|
||||||
int window_routing_id = web_contents->GetRoutingID();
|
int window_routing_id = web_contents->GetRoutingID();
|
||||||
|
@ -78,23 +79,23 @@ NativeWindow* NativeWindow::FromRenderView(int process_id, int routing_id) {
|
||||||
|
|
||||||
void NativeWindow::InitFromOptions(base::DictionaryValue* options) {
|
void NativeWindow::InitFromOptions(base::DictionaryValue* options) {
|
||||||
// Setup window from options.
|
// Setup window from options.
|
||||||
int x, y;
|
int x = -1, y = -1;
|
||||||
bool center;
|
bool center;
|
||||||
if (options->GetInteger(switches::kX, &x) &&
|
if (options->GetInteger(switches::kX, &x) &&
|
||||||
options->GetInteger(switches::kY, &y)) {
|
options->GetInteger(switches::kY, &y)) {
|
||||||
int width, height;
|
int width = -1, height = -1;
|
||||||
options->GetInteger(switches::kWidth, &width);
|
options->GetInteger(switches::kWidth, &width);
|
||||||
options->GetInteger(switches::kHeight, &height);
|
options->GetInteger(switches::kHeight, &height);
|
||||||
Move(gfx::Rect(x, y, width, height));
|
Move(gfx::Rect(x, y, width, height));
|
||||||
} else if (options->GetBoolean(switches::kCenter, ¢er) && center) {
|
} else if (options->GetBoolean(switches::kCenter, ¢er) && center) {
|
||||||
Center();
|
Center();
|
||||||
}
|
}
|
||||||
int min_height, min_width;
|
int min_height = -1, min_width = -1;
|
||||||
if (options->GetInteger(switches::kMinHeight, &min_height) &&
|
if (options->GetInteger(switches::kMinHeight, &min_height) &&
|
||||||
options->GetInteger(switches::kMinWidth, &min_width)) {
|
options->GetInteger(switches::kMinWidth, &min_width)) {
|
||||||
SetMinimumSize(gfx::Size(min_width, min_height));
|
SetMinimumSize(gfx::Size(min_width, min_height));
|
||||||
}
|
}
|
||||||
int max_height, max_width;
|
int max_height = -1, max_width = -1;
|
||||||
if (options->GetInteger(switches::kMaxHeight, &max_height) &&
|
if (options->GetInteger(switches::kMaxHeight, &max_height) &&
|
||||||
options->GetInteger(switches::kMaxWidth, &max_width)) {
|
options->GetInteger(switches::kMaxWidth, &max_width)) {
|
||||||
SetMaximumSize(gfx::Size(max_width, max_height));
|
SetMaximumSize(gfx::Size(max_width, max_height));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue