| 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.h" | 10 #include "base/message_loop.h" |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 popup_->GetNativeView()->GetRootWindow()->GetAcceleratedWidget(); | 294 popup_->GetNativeView()->GetRootWindow()->GetAcceleratedWidget(); |
| 295 #else | 295 #else |
| 296 toast_window = popup_->GetNativeView(); | 296 toast_window = popup_->GetNativeView(); |
| 297 #endif | 297 #endif |
| 298 SetToastRegion(toast_window, preferred.width(), preferred.height()); | 298 SetToastRegion(toast_window, preferred.width(), preferred.height()); |
| 299 | 299 |
| 300 // Time to show the window in a modal loop. | 300 // Time to show the window in a modal loop. |
| 301 popup_->Show(); | 301 popup_->Show(); |
| 302 if (!listener.is_null()) | 302 if (!listener.is_null()) |
| 303 listener.Run(popup_->GetNativeView()); | 303 listener.Run(popup_->GetNativeView()); |
| 304 MessageLoop::current()->Run(); | 304 base::MessageLoop::current()->Run(); |
| 305 if (!listener.is_null()) | 305 if (!listener.is_null()) |
| 306 listener.Run(NULL); | 306 listener.Run(NULL); |
| 307 return result_; | 307 return result_; |
| 308 } | 308 } |
| 309 | 309 |
| 310 gfx::Rect TryChromeDialogView::ComputeWindowPosition(int width, | 310 gfx::Rect TryChromeDialogView::ComputeWindowPosition(int width, |
| 311 int height, | 311 int height, |
| 312 bool is_RTL) { | 312 bool is_RTL) { |
| 313 // The 'Shell_TrayWnd' is the taskbar. We like to show our window in that | 313 // The 'Shell_TrayWnd' is the taskbar. We like to show our window in that |
| 314 // monitor if we can. This code works even if such window is not found. | 314 // monitor if we can. This code works even if such window is not found. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 else | 367 else |
| 368 NOTREACHED() << "Unknown radio button selected"; | 368 NOTREACHED() << "Unknown radio button selected"; |
| 369 } | 369 } |
| 370 | 370 |
| 371 if (make_default_) { | 371 if (make_default_) { |
| 372 if ((result_ == TRY_CHROME) && make_default_->checked()) | 372 if ((result_ == TRY_CHROME) && make_default_->checked()) |
| 373 result_ = TRY_CHROME_AS_DEFAULT; | 373 result_ = TRY_CHROME_AS_DEFAULT; |
| 374 } | 374 } |
| 375 | 375 |
| 376 popup_->Close(); | 376 popup_->Close(); |
| 377 MessageLoop::current()->Quit(); | 377 base::MessageLoop::current()->Quit(); |
| 378 } | 378 } |
| 379 | 379 |
| 380 void TryChromeDialogView::LinkClicked(views::Link* source, int event_flags) { | 380 void TryChromeDialogView::LinkClicked(views::Link* source, int event_flags) { |
| 381 ::ShellExecuteW(NULL, L"open", kHelpCenterUrl, NULL, NULL, SW_SHOW); | 381 ::ShellExecuteW(NULL, L"open", kHelpCenterUrl, NULL, NULL, SW_SHOW); |
| 382 } | 382 } |
| OLD | NEW |