| 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 separator->SetSize(gfx::Size(preferred.width(), separator_height)); | 276 separator->SetSize(gfx::Size(preferred.width(), separator_height)); |
| 277 } | 277 } |
| 278 | 278 |
| 279 gfx::Rect pos = ComputeWindowPosition(preferred.width(), preferred.height(), | 279 gfx::Rect pos = ComputeWindowPosition(preferred.width(), preferred.height(), |
| 280 base::i18n::IsRTL()); | 280 base::i18n::IsRTL()); |
| 281 popup_->SetBounds(pos); | 281 popup_->SetBounds(pos); |
| 282 | 282 |
| 283 // Carve the toast shape into the window. | 283 // Carve the toast shape into the window. |
| 284 HWND toast_window; | 284 HWND toast_window; |
| 285 #if defined(USE_AURA) | 285 #if defined(USE_AURA) |
| 286 toast_window = | 286 toast_window = popup_->GetNativeView()->GetHost()->GetAcceleratedWidget(); |
| 287 popup_->GetNativeView()->GetDispatcher()->host()->GetAcceleratedWidget(); | |
| 288 #else | 287 #else |
| 289 toast_window = popup_->GetNativeView(); | 288 toast_window = popup_->GetNativeView(); |
| 290 #endif | 289 #endif |
| 291 SetToastRegion(toast_window, preferred.width(), preferred.height()); | 290 SetToastRegion(toast_window, preferred.width(), preferred.height()); |
| 292 | 291 |
| 293 // Time to show the window in a modal loop. | 292 // Time to show the window in a modal loop. |
| 294 popup_->Show(); | 293 popup_->Show(); |
| 295 if (!listener.is_null()) | 294 if (!listener.is_null()) |
| 296 listener.Run(popup_->GetNativeView()); | 295 listener.Run(popup_->GetNativeView()); |
| 297 base::MessageLoop::current()->Run(); | 296 base::MessageLoop::current()->Run(); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 result_ = TRY_CHROME_AS_DEFAULT; | 365 result_ = TRY_CHROME_AS_DEFAULT; |
| 367 } | 366 } |
| 368 | 367 |
| 369 popup_->Close(); | 368 popup_->Close(); |
| 370 base::MessageLoop::current()->Quit(); | 369 base::MessageLoop::current()->Quit(); |
| 371 } | 370 } |
| 372 | 371 |
| 373 void TryChromeDialogView::LinkClicked(views::Link* source, int event_flags) { | 372 void TryChromeDialogView::LinkClicked(views::Link* source, int event_flags) { |
| 374 ::ShellExecuteW(NULL, L"open", kHelpCenterUrl, NULL, NULL, SW_SHOW); | 373 ::ShellExecuteW(NULL, L"open", kHelpCenterUrl, NULL, NULL, SW_SHOW); |
| 375 } | 374 } |
| OLD | NEW |