| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 Layout(); | 85 Layout(); |
| 86 | 86 |
| 87 // Resize the widget, keeping the same origin. | 87 // Resize the widget, keeping the same origin. |
| 88 gfx::Rect bounds = GetWidget()->GetWindowBoundsInScreen(); | 88 gfx::Rect bounds = GetWidget()->GetWindowBoundsInScreen(); |
| 89 bounds.set_size(GetWidget()->GetRootView()->GetPreferredSize()); | 89 bounds.set_size(GetWidget()->GetRootView()->GetPreferredSize()); |
| 90 GetWidget()->SetBounds(bounds); | 90 GetWidget()->SetBounds(bounds); |
| 91 | 91 |
| 92 // Resizing a widget on chromeos doesn't automatically resize the root, need | 92 // Resizing a widget on chromeos doesn't automatically resize the root, need |
| 93 // to explicitly do that. | 93 // to explicitly do that. |
| 94 #if defined(OS_CHROMEOS) | 94 #if defined(OS_CHROMEOS) |
| 95 GetWidget()->GetNativeWindow()->GetHost()->SetBounds(bounds); | 95 GetWidget()->GetNativeWindow()->GetHost()->SetBoundsInPixels(bounds); |
| 96 #endif | 96 #endif |
| 97 } | 97 } |
| 98 | 98 |
| 99 void SetWindowTitle(const base::string16& title) { title_ = title; } | 99 void SetWindowTitle(const base::string16& title) { title_ = title; } |
| 100 void EnableUIControl(UIControl control, bool is_enabled) { | 100 void EnableUIControl(UIControl control, bool is_enabled) { |
| 101 if (control == BACK_BUTTON) { | 101 if (control == BACK_BUTTON) { |
| 102 back_button_->SetState(is_enabled ? views::CustomButton::STATE_NORMAL | 102 back_button_->SetState(is_enabled ? views::CustomButton::STATE_NORMAL |
| 103 : views::CustomButton::STATE_DISABLED); | 103 : views::CustomButton::STATE_DISABLED); |
| 104 } else if (control == FORWARD_BUTTON) { | 104 } else if (control == FORWARD_BUTTON) { |
| 105 forward_button_->SetState(is_enabled ? views::CustomButton::STATE_NORMAL | 105 forward_button_->SetState(is_enabled ? views::CustomButton::STATE_NORMAL |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 void Shell::PlatformSetTitle(const base::string16& title) { | 458 void Shell::PlatformSetTitle(const base::string16& title) { |
| 459 if (headless_) | 459 if (headless_) |
| 460 return; | 460 return; |
| 461 ShellWindowDelegateView* delegate_view = | 461 ShellWindowDelegateView* delegate_view = |
| 462 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); | 462 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); |
| 463 delegate_view->SetWindowTitle(title); | 463 delegate_view->SetWindowTitle(title); |
| 464 window_widget_->UpdateWindowTitle(); | 464 window_widget_->UpdateWindowTitle(); |
| 465 } | 465 } |
| 466 | 466 |
| 467 } // namespace content | 467 } // namespace content |
| OLD | NEW |