OLD | NEW |
---|---|
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 Loading... | |
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->SetPreferredSize(preferred.width()); |
273 separator->SetSize(gfx::Size(preferred.width(), separator_height)); | 273 separator->SetSize(separator->GetPreferredSize()); |
sky
2014/11/19 20:30:19
You shouldn't change this code. Leave it as is.
| |
274 } | 274 } |
275 | 275 |
276 gfx::Rect pos = ComputeWindowPosition(preferred.width(), preferred.height(), | 276 gfx::Rect pos = ComputeWindowPosition(preferred.width(), preferred.height(), |
277 base::i18n::IsRTL()); | 277 base::i18n::IsRTL()); |
278 popup_->SetBounds(pos); | 278 popup_->SetBounds(pos); |
279 | 279 |
280 // Carve the toast shape into the window. | 280 // Carve the toast shape into the window. |
281 HWND toast_window; | 281 HWND toast_window; |
282 toast_window = popup_->GetNativeView()->GetHost()->GetAcceleratedWidget(); | 282 toast_window = popup_->GetNativeView()->GetHost()->GetAcceleratedWidget(); |
283 SetToastRegion(toast_window, preferred.width(), preferred.height()); | 283 SetToastRegion(toast_window, preferred.width(), preferred.height()); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
358 result_ = TRY_CHROME_AS_DEFAULT; | 358 result_ = TRY_CHROME_AS_DEFAULT; |
359 } | 359 } |
360 | 360 |
361 popup_->Close(); | 361 popup_->Close(); |
362 base::MessageLoop::current()->Quit(); | 362 base::MessageLoop::current()->Quit(); |
363 } | 363 } |
364 | 364 |
365 void TryChromeDialogView::LinkClicked(views::Link* source, int event_flags) { | 365 void TryChromeDialogView::LinkClicked(views::Link* source, int event_flags) { |
366 ::ShellExecuteW(NULL, L"open", kHelpCenterUrl, NULL, NULL, SW_SHOW); | 366 ::ShellExecuteW(NULL, L"open", kHelpCenterUrl, NULL, NULL, SW_SHOW); |
367 } | 367 } |
OLD | NEW |