Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(679)

Side by Side Diff: content/shell/browser/shell_views.cc

Issue 2524873002: Rename WindowTreeHost G|SetBounds to indicate they are in pixels. (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/shell/browser/shell_platform_data_aura.cc ('k') | ui/aura/mus/window_tree_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/shell/browser/shell_platform_data_aura.cc ('k') | ui/aura/mus/window_tree_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698