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