| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 Layout(); | 94 Layout(); |
| 95 | 95 |
| 96 // Resize the widget, keeping the same origin. | 96 // Resize the widget, keeping the same origin. |
| 97 gfx::Rect bounds = GetWidget()->GetWindowBoundsInScreen(); | 97 gfx::Rect bounds = GetWidget()->GetWindowBoundsInScreen(); |
| 98 bounds.set_size(GetWidget()->GetRootView()->GetPreferredSize()); | 98 bounds.set_size(GetWidget()->GetRootView()->GetPreferredSize()); |
| 99 GetWidget()->SetBounds(bounds); | 99 GetWidget()->SetBounds(bounds); |
| 100 | 100 |
| 101 // Resizing a widget on chromeos doesn't automatically resize the root, need | 101 // Resizing a widget on chromeos doesn't automatically resize the root, need |
| 102 // to explicitly do that. | 102 // to explicitly do that. |
| 103 #if defined(OS_CHROMEOS) | 103 #if defined(OS_CHROMEOS) |
| 104 GetWidget()->GetNativeWindow()->GetDispatcher()->SetHostSize( | 104 GetWidget()->GetNativeWindow()->GetDispatcher()->host()->SetBounds(bounds); |
| 105 bounds.size()); | |
| 106 #endif | 105 #endif |
| 107 } | 106 } |
| 108 | 107 |
| 109 void SetWindowTitle(const base::string16& title) { title_ = title; } | 108 void SetWindowTitle(const base::string16& title) { title_ = title; } |
| 110 void EnableUIControl(UIControl control, bool is_enabled) { | 109 void EnableUIControl(UIControl control, bool is_enabled) { |
| 111 if (control == BACK_BUTTON) { | 110 if (control == BACK_BUTTON) { |
| 112 back_button_->SetState(is_enabled ? views::CustomButton::STATE_NORMAL | 111 back_button_->SetState(is_enabled ? views::CustomButton::STATE_NORMAL |
| 113 : views::CustomButton::STATE_DISABLED); | 112 : views::CustomButton::STATE_DISABLED); |
| 114 } else if (control == FORWARD_BUTTON) { | 113 } else if (control == FORWARD_BUTTON) { |
| 115 forward_button_->SetState(is_enabled ? views::CustomButton::STATE_NORMAL | 114 forward_button_->SetState(is_enabled ? views::CustomButton::STATE_NORMAL |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 } | 385 } |
| 387 | 386 |
| 388 void Shell::PlatformSetTitle(const base::string16& title) { | 387 void Shell::PlatformSetTitle(const base::string16& title) { |
| 389 ShellWindowDelegateView* delegate_view = | 388 ShellWindowDelegateView* delegate_view = |
| 390 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); | 389 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); |
| 391 delegate_view->SetWindowTitle(title); | 390 delegate_view->SetWindowTitle(title); |
| 392 window_widget_->UpdateWindowTitle(); | 391 window_widget_->UpdateWindowTitle(); |
| 393 } | 392 } |
| 394 | 393 |
| 395 } // namespace content | 394 } // namespace content |
| OLD | NEW |