Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/shell.h" | 5 #include "content/shell/shell.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
| 10 #include "ui/aura/env.h" | 10 #include "ui/aura/env.h" |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 331 } | 331 } |
| 332 | 332 |
| 333 void Shell::PlatformSetIsLoading(bool loading) { | 333 void Shell::PlatformSetIsLoading(bool loading) { |
| 334 } | 334 } |
| 335 | 335 |
| 336 void Shell::PlatformCreateWindow(int width, int height) { | 336 void Shell::PlatformCreateWindow(int width, int height) { |
| 337 window_widget_ = | 337 window_widget_ = |
| 338 views::Widget::CreateWindowWithBounds(new ShellWindowDelegateView(this), | 338 views::Widget::CreateWindowWithBounds(new ShellWindowDelegateView(this), |
| 339 gfx::Rect(0, 0, width, height)); | 339 gfx::Rect(0, 0, width, height)); |
| 340 window_ = window_widget_->GetNativeWindow(); | 340 window_ = window_widget_->GetNativeWindow(); |
| 341 window_->GetRootWindow()->SetHostSize(gfx::Size(width, height)); | |
|
sky
2013/01/08 01:20:05
Why is this needed?
Nayan
2013/01/08 02:25:38
By default, ShellStackingClientAsh creates root wi
sky
2013/01/08 18:28:15
Shouldn't the size passed to CreateWindowWithBound
Nayan
2013/01/13 03:07:18
Done.
| |
| 342 window_->GetRootWindow()->ShowRootWindow(); | |
| 341 window_widget_->Show(); | 343 window_widget_->Show(); |
| 342 } | 344 } |
| 343 | 345 |
| 344 void Shell::PlatformSetContents() { | 346 void Shell::PlatformSetContents() { |
| 345 ShellWindowDelegateView* delegate_view = | 347 ShellWindowDelegateView* delegate_view = |
| 346 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); | 348 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); |
| 347 delegate_view->SetWebContents(web_contents_.get()); | 349 delegate_view->SetWebContents(web_contents_.get()); |
| 348 } | 350 } |
| 349 | 351 |
| 350 void Shell::PlatformResizeSubViews() { | 352 void Shell::PlatformResizeSubViews() { |
| 351 } | 353 } |
| 352 | 354 |
| 353 void Shell::Close() { | 355 void Shell::Close() { |
| 354 window_widget_->Close(); | 356 window_widget_->Close(); |
| 355 } | 357 } |
| 356 | 358 |
| 357 void Shell::PlatformSetTitle(const string16& title) { | 359 void Shell::PlatformSetTitle(const string16& title) { |
| 358 ShellWindowDelegateView* delegate_view = | 360 ShellWindowDelegateView* delegate_view = |
| 359 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); | 361 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); |
| 360 delegate_view->SetWindowTitle(title); | 362 delegate_view->SetWindowTitle(title); |
| 361 window_widget_->UpdateWindowTitle(); | 363 window_widget_->UpdateWindowTitle(); |
| 362 } | 364 } |
| 363 | 365 |
| 364 } // namespace content | 366 } // namespace content |
| OLD | NEW |