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

Side by Side Diff: chrome/browser/chromeos/options/network_config_view.cc

Issue 10795013: Rename bounds accessors to be intuitive and consistent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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
OLDNEW
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 "chrome/browser/chromeos/options/network_config_view.h" 5 #include "chrome/browser/chromeos/options/network_config_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 RemoveChildView(child_config_view_); 206 RemoveChildView(child_config_view_);
207 delete child_config_view_; 207 delete child_config_view_;
208 // For now, there is only an advanced view for Wi-Fi 802.1X. 208 // For now, there is only an advanced view for Wi-Fi 802.1X.
209 child_config_view_ = new WifiConfigView(this, true /* show_8021x */); 209 child_config_view_ = new WifiConfigView(this, true /* show_8021x */);
210 AddChildView(child_config_view_); 210 AddChildView(child_config_view_);
211 // Resize the window to be able to hold the new widgets. 211 // Resize the window to be able to hold the new widgets.
212 gfx::Size size = views::Widget::GetLocalizedContentsSize( 212 gfx::Size size = views::Widget::GetLocalizedContentsSize(
213 IDS_JOIN_WIFI_NETWORK_DIALOG_ADVANCED_WIDTH_CHARS, 213 IDS_JOIN_WIFI_NETWORK_DIALOG_ADVANCED_WIDTH_CHARS,
214 IDS_JOIN_WIFI_NETWORK_DIALOG_ADVANCED_MINIMUM_HEIGHT_LINES); 214 IDS_JOIN_WIFI_NETWORK_DIALOG_ADVANCED_MINIMUM_HEIGHT_LINES);
215 // Get the new bounds with desired size at the same center point. 215 // Get the new bounds with desired size at the same center point.
216 gfx::Rect bounds = GetWidget()->GetWindowScreenBounds(); 216 gfx::Rect bounds = GetWidget()->GetWindowBoundsInScreen();
217 int horiz_padding = bounds.width() - size.width(); 217 int horiz_padding = bounds.width() - size.width();
218 int vert_padding = bounds.height() - size.height(); 218 int vert_padding = bounds.height() - size.height();
219 bounds.Inset(horiz_padding / 2, vert_padding / 2, 219 bounds.Inset(horiz_padding / 2, vert_padding / 2,
220 horiz_padding / 2, vert_padding / 2); 220 horiz_padding / 2, vert_padding / 2);
221 GetWidget()->SetBoundsConstrained(bounds); 221 GetWidget()->SetBoundsConstrained(bounds);
222 Layout(); 222 Layout();
223 child_config_view_->InitFocus(); 223 child_config_view_->InitFocus();
224 } 224 }
225 225
226 void NetworkConfigView::Layout() { 226 void NetworkConfigView::Layout() {
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 image_view_ = new views::ImageView(); 317 image_view_ = new views::ImageView();
318 // Disable |image_view_| so mouse events propagate to the parent. 318 // Disable |image_view_| so mouse events propagate to the parent.
319 image_view_->SetEnabled(false); 319 image_view_->SetEnabled(false);
320 image_view_->SetImage(gray_image_); 320 image_view_->SetImage(gray_image_);
321 image_view_->SetTooltipText( 321 image_view_->SetTooltipText(
322 l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_POLICY)); 322 l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_POLICY));
323 AddChildView(image_view_); 323 AddChildView(image_view_);
324 } 324 }
325 325
326 } // namespace chromeos 326 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/screen_locker_browsertest.cc ('k') | chrome/browser/chromeos/status/data_promo_notification.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698