| 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/macros.h" | 10 #include "base/macros.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 params.bounds = gfx::Rect(310, 200); | 94 params.bounds = gfx::Rect(310, 200); |
| 95 popup_ = new views::Widget; | 95 popup_ = new views::Widget; |
| 96 popup_->Init(params); | 96 popup_->Init(params); |
| 97 | 97 |
| 98 views::View* root_view = popup_->GetRootView(); | 98 views::View* root_view = popup_->GetRootView(); |
| 99 // The window color is a tiny bit off-white. | 99 // The window color is a tiny bit off-white. |
| 100 root_view->set_background( | 100 root_view->set_background( |
| 101 views::Background::CreateSolidBackground(0xfc, 0xfc, 0xfc)); | 101 views::Background::CreateSolidBackground(0xfc, 0xfc, 0xfc)); |
| 102 | 102 |
| 103 views::GridLayout* layout = views::GridLayout::CreatePanel(root_view); | 103 views::GridLayout* layout = views::GridLayout::CreatePanel(root_view); |
| 104 root_view->SetLayoutManager(layout); | |
| 105 views::ColumnSet* columns; | 104 views::ColumnSet* columns; |
| 106 | 105 |
| 107 // First row: [icon][pad][text][pad][button]. | 106 // First row: [icon][pad][text][pad][button]. |
| 108 columns = layout->AddColumnSet(0); | 107 columns = layout->AddColumnSet(0); |
| 109 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::LEADING, 0, | 108 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::LEADING, 0, |
| 110 views::GridLayout::FIXED, icon_size.width(), | 109 views::GridLayout::FIXED, icon_size.width(), |
| 111 icon_size.height()); | 110 icon_size.height()); |
| 112 columns->AddPaddingColumn(0, views::kRelatedControlHorizontalSpacing); | 111 columns->AddPaddingColumn(0, views::kRelatedControlHorizontalSpacing); |
| 113 columns->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, | 112 columns->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, |
| 114 views::GridLayout::USE_PREF, 0, 0); | 113 views::GridLayout::USE_PREF, 0, 0); |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 result_ = TRY_CHROME_AS_DEFAULT; | 361 result_ = TRY_CHROME_AS_DEFAULT; |
| 363 } | 362 } |
| 364 | 363 |
| 365 popup_->Close(); | 364 popup_->Close(); |
| 366 base::MessageLoop::current()->QuitWhenIdle(); | 365 base::MessageLoop::current()->QuitWhenIdle(); |
| 367 } | 366 } |
| 368 | 367 |
| 369 void TryChromeDialogView::LinkClicked(views::Link* source, int event_flags) { | 368 void TryChromeDialogView::LinkClicked(views::Link* source, int event_flags) { |
| 370 ::ShellExecuteW(NULL, L"open", kHelpCenterUrl, NULL, NULL, SW_SHOW); | 369 ::ShellExecuteW(NULL, L"open", kHelpCenterUrl, NULL, NULL, SW_SHOW); |
| 371 } | 370 } |
| OLD | NEW |