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

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

Issue 133003002: Revert 244005 "Remove SetHostSize/Bounds from RootWindow in favo..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 11 months 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 | Annotate | Revision Log
« no previous file with comments | « trunk/src/content/shell/browser/shell_aura.cc ('k') | trunk/src/ui/aura/root_window.h » ('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 "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
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()->host()->SetBounds(bounds); 104 GetWidget()->GetNativeWindow()->GetDispatcher()->SetHostSize(
105 bounds.size());
105 #endif 106 #endif
106 } 107 }
107 108
108 void SetWindowTitle(const base::string16& title) { title_ = title; } 109 void SetWindowTitle(const base::string16& title) { title_ = title; }
109 void EnableUIControl(UIControl control, bool is_enabled) { 110 void EnableUIControl(UIControl control, bool is_enabled) {
110 if (control == BACK_BUTTON) { 111 if (control == BACK_BUTTON) {
111 back_button_->SetState(is_enabled ? views::CustomButton::STATE_NORMAL 112 back_button_->SetState(is_enabled ? views::CustomButton::STATE_NORMAL
112 : views::CustomButton::STATE_DISABLED); 113 : views::CustomButton::STATE_DISABLED);
113 } else if (control == FORWARD_BUTTON) { 114 } else if (control == FORWARD_BUTTON) {
114 forward_button_->SetState(is_enabled ? views::CustomButton::STATE_NORMAL 115 forward_button_->SetState(is_enabled ? views::CustomButton::STATE_NORMAL
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 } 386 }
386 387
387 void Shell::PlatformSetTitle(const base::string16& title) { 388 void Shell::PlatformSetTitle(const base::string16& title) {
388 ShellWindowDelegateView* delegate_view = 389 ShellWindowDelegateView* delegate_view =
389 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); 390 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate());
390 delegate_view->SetWindowTitle(title); 391 delegate_view->SetWindowTitle(title);
391 window_widget_->UpdateWindowTitle(); 392 window_widget_->UpdateWindowTitle();
392 } 393 }
393 394
394 } // namespace content 395 } // namespace content
OLDNEW
« no previous file with comments | « trunk/src/content/shell/browser/shell_aura.cc ('k') | trunk/src/ui/aura/root_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698