| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 TryChromeDialogView::Result TryChromeDialogView::ShowModal( | 60 TryChromeDialogView::Result TryChromeDialogView::ShowModal( |
| 61 ProcessSingleton* process_singleton) { | 61 ProcessSingleton* process_singleton) { |
| 62 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 62 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 63 | 63 |
| 64 views::ImageView* icon = new views::ImageView(); | 64 views::ImageView* icon = new views::ImageView(); |
| 65 icon->SetImage(*rb.GetBitmapNamed(IDR_PRODUCT_ICON_32)); | 65 icon->SetImage(*rb.GetBitmapNamed(IDR_PRODUCT_ICON_32)); |
| 66 gfx::Size icon_size = icon->GetPreferredSize(); | 66 gfx::Size icon_size = icon->GetPreferredSize(); |
| 67 | 67 |
| 68 // An approximate window size. After Layout() we'll get better bounds. | 68 // An approximate window size. After Layout() we'll get better bounds. |
| 69 popup_ = views::Widget::CreateWidget(); | 69 popup_ = new views::Widget; |
| 70 if (!popup_) { | 70 if (!popup_) { |
| 71 NOTREACHED(); | 71 NOTREACHED(); |
| 72 return DIALOG_ERROR; | 72 return DIALOG_ERROR; |
| 73 } | 73 } |
| 74 | 74 |
| 75 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); | 75 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); |
| 76 params.can_activate = true; | 76 params.can_activate = true; |
| 77 params.bounds = gfx::Rect(310, 160); | 77 params.bounds = gfx::Rect(310, 160); |
| 78 popup_->Init(params); | 78 popup_->Init(params); |
| 79 | 79 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 // The outcome is according to the selected ratio button. | 253 // The outcome is according to the selected ratio button. |
| 254 result_ = try_chrome_->checked() ? TRY_CHROME : UNINSTALL_CHROME; | 254 result_ = try_chrome_->checked() ? TRY_CHROME : UNINSTALL_CHROME; |
| 255 } | 255 } |
| 256 popup_->Close(); | 256 popup_->Close(); |
| 257 MessageLoop::current()->Quit(); | 257 MessageLoop::current()->Quit(); |
| 258 } | 258 } |
| 259 | 259 |
| 260 void TryChromeDialogView::LinkClicked(views::Link* source, int event_flags) { | 260 void TryChromeDialogView::LinkClicked(views::Link* source, int event_flags) { |
| 261 ::ShellExecuteW(NULL, L"open", kHelpCenterUrl, NULL, NULL, SW_SHOW); | 261 ::ShellExecuteW(NULL, L"open", kHelpCenterUrl, NULL, NULL, SW_SHOW); |
| 262 } | 262 } |
| OLD | NEW |