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

Side by Side Diff: chrome/browser/first_run/try_chrome_dialog_view.cc

Issue 736613002: Makes Separator more configurable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Width from layout Created 6 years, 1 month 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 | « no previous file | ui/views/controls/separator.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 (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/first_run/try_chrome_dialog_view.h" 5 #include "chrome/browser/first_run/try_chrome_dialog_view.h"
6 6
7 #include <shellapi.h> 7 #include <shellapi.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 l10n_util::GetStringUTF16(IDS_TRY_TOAST_WHY)); 262 l10n_util::GetStringUTF16(IDS_TRY_TOAST_WHY));
263 link->set_listener(this); 263 link->set_listener(this);
264 layout->AddView(link); 264 layout->AddView(link);
265 } 265 }
266 266
267 // We resize the window according to the layout manager. This takes into 267 // We resize the window according to the layout manager. This takes into
268 // account the differences between XP and Vista fonts and buttons. 268 // account the differences between XP and Vista fonts and buttons.
269 layout->Layout(root_view); 269 layout->Layout(root_view);
270 gfx::Size preferred = layout->GetPreferredSize(root_view); 270 gfx::Size preferred = layout->GetPreferredSize(root_view);
271 if (separator) { 271 if (separator) {
272 int separator_height = separator->GetPreferredSize().height(); 272 separator->SetSize(preferred.width());
sky 2014/11/19 16:10:17 Separator::SetSize is much different than View::Se
273 separator->SetSize(gfx::Size(preferred.width(), separator_height));
274 } 273 }
275 274
276 gfx::Rect pos = ComputeWindowPosition(preferred.width(), preferred.height(), 275 gfx::Rect pos = ComputeWindowPosition(preferred.width(), preferred.height(),
277 base::i18n::IsRTL()); 276 base::i18n::IsRTL());
278 popup_->SetBounds(pos); 277 popup_->SetBounds(pos);
279 278
280 // Carve the toast shape into the window. 279 // Carve the toast shape into the window.
281 HWND toast_window; 280 HWND toast_window;
282 toast_window = popup_->GetNativeView()->GetHost()->GetAcceleratedWidget(); 281 toast_window = popup_->GetNativeView()->GetHost()->GetAcceleratedWidget();
283 SetToastRegion(toast_window, preferred.width(), preferred.height()); 282 SetToastRegion(toast_window, preferred.width(), preferred.height());
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 result_ = TRY_CHROME_AS_DEFAULT; 357 result_ = TRY_CHROME_AS_DEFAULT;
359 } 358 }
360 359
361 popup_->Close(); 360 popup_->Close();
362 base::MessageLoop::current()->Quit(); 361 base::MessageLoop::current()->Quit();
363 } 362 }
364 363
365 void TryChromeDialogView::LinkClicked(views::Link* source, int event_flags) { 364 void TryChromeDialogView::LinkClicked(views::Link* source, int event_flags) {
366 ::ShellExecuteW(NULL, L"open", kHelpCenterUrl, NULL, NULL, SW_SHOW); 365 ::ShellExecuteW(NULL, L"open", kHelpCenterUrl, NULL, NULL, SW_SHOW);
367 } 366 }
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/separator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698