| 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/ui/views/try_chrome_dialog_view.h" | 5 #include "chrome/browser/ui/views/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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 views::GridLayout* layout = views::GridLayout::CreatePanel(root_view); | 105 views::GridLayout* layout = views::GridLayout::CreatePanel(root_view); |
| 106 views::ColumnSet* columns; | 106 views::ColumnSet* columns; |
| 107 | 107 |
| 108 ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); | 108 ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); |
| 109 const int label_spacing = | 109 const int label_spacing = |
| 110 provider->GetDistanceMetric(DISTANCE_RELATED_LABEL_HORIZONTAL); | 110 provider->GetDistanceMetric(DISTANCE_RELATED_LABEL_HORIZONTAL); |
| 111 const int unrelated_space_horiz = | 111 const int unrelated_space_horiz = |
| 112 provider->GetDistanceMetric(DISTANCE_UNRELATED_CONTROL_HORIZONTAL); | 112 provider->GetDistanceMetric(DISTANCE_UNRELATED_CONTROL_HORIZONTAL); |
| 113 const int unrelated_space_vert = | 113 const int unrelated_space_vert = |
| 114 provider->GetDistanceMetric(DISTANCE_UNRELATED_CONTROL_VERTICAL); | 114 provider->GetDistanceMetric(views::DISTANCE_UNRELATED_CONTROL_VERTICAL); |
| 115 const int button_spacing_horiz = | 115 const int button_spacing_horiz = |
| 116 provider->GetDistanceMetric(views::DISTANCE_RELATED_BUTTON_HORIZONTAL); | 116 provider->GetDistanceMetric(views::DISTANCE_RELATED_BUTTON_HORIZONTAL); |
| 117 | 117 |
| 118 // First row: [icon][pad][text][pad][button]. | 118 // First row: [icon][pad][text][pad][button]. |
| 119 columns = layout->AddColumnSet(0); | 119 columns = layout->AddColumnSet(0); |
| 120 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::LEADING, 0, | 120 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::LEADING, 0, |
| 121 views::GridLayout::FIXED, icon_size.width(), | 121 views::GridLayout::FIXED, icon_size.width(), |
| 122 icon_size.height()); | 122 icon_size.height()); |
| 123 columns->AddPaddingColumn(0, label_spacing); | 123 columns->AddPaddingColumn(0, label_spacing); |
| 124 columns->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, | 124 columns->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 result_ = TRY_CHROME_AS_DEFAULT; | 370 result_ = TRY_CHROME_AS_DEFAULT; |
| 371 } | 371 } |
| 372 | 372 |
| 373 popup_->Close(); | 373 popup_->Close(); |
| 374 base::MessageLoop::current()->QuitWhenIdle(); | 374 base::MessageLoop::current()->QuitWhenIdle(); |
| 375 } | 375 } |
| 376 | 376 |
| 377 void TryChromeDialogView::LinkClicked(views::Link* source, int event_flags) { | 377 void TryChromeDialogView::LinkClicked(views::Link* source, int event_flags) { |
| 378 ::ShellExecuteW(NULL, L"open", kHelpCenterUrl, NULL, NULL, SW_SHOW); | 378 ::ShellExecuteW(NULL, L"open", kHelpCenterUrl, NULL, NULL, SW_SHOW); |
| 379 } | 379 } |
| OLD | NEW |