| 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/create_application_shortcut_view.h" | 5 #include "chrome/browser/ui/views/create_application_shortcut_view.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" | 11 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" |
| 12 #include "chrome/common/pref_names.h" | 12 #include "chrome/common/pref_names.h" |
| 13 #include "chrome/grit/generated_resources.h" | 13 #include "chrome/grit/generated_resources.h" |
| 14 #include "components/constrained_window/constrained_window_views.h" | 14 #include "components/constrained_window/constrained_window_views.h" |
| 15 #include "components/prefs/pref_service.h" | 15 #include "components/prefs/pref_service.h" |
| 16 #include "extensions/common/extension.h" | 16 #include "extensions/common/extension.h" |
| 17 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
| 18 #include "ui/views/controls/button/checkbox.h" | 18 #include "ui/views/controls/button/checkbox.h" |
| 19 #include "ui/views/controls/label.h" | 19 #include "ui/views/controls/label.h" |
| 20 #include "ui/views/layout/grid_layout.h" | 20 #include "ui/views/layout/grid_layout.h" |
| 21 #include "ui/views/layout/layout_constants.h" | |
| 22 #include "ui/views/window/dialog_client_view.h" | 21 #include "ui/views/window/dialog_client_view.h" |
| 23 | 22 |
| 24 #if defined(OS_WIN) | 23 #if defined(OS_WIN) |
| 25 #include "base/win/shortcut.h" | 24 #include "base/win/shortcut.h" |
| 26 #include "base/win/windows_version.h" | 25 #include "base/win/windows_version.h" |
| 27 #endif // defined(OS_WIN) | 26 #endif // defined(OS_WIN) |
| 28 | 27 |
| 29 namespace chrome { | 28 namespace chrome { |
| 30 | 29 |
| 31 void ShowCreateChromeAppShortcutsDialog( | 30 void ShowCreateChromeAppShortcutsDialog( |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 static const int kTableColumnSetId = 1; | 113 static const int kTableColumnSetId = 1; |
| 115 column_set = layout->AddColumnSet(kTableColumnSetId); | 114 column_set = layout->AddColumnSet(kTableColumnSetId); |
| 116 column_set->AddPaddingColumn( | 115 column_set->AddPaddingColumn( |
| 117 0, provider->GetDistanceMetric(DISTANCE_SUBSECTION_HORIZONTAL_INDENT)); | 116 0, provider->GetDistanceMetric(DISTANCE_SUBSECTION_HORIZONTAL_INDENT)); |
| 118 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, | 117 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, |
| 119 100.0f, views::GridLayout::USE_PREF, 0, 0); | 118 100.0f, views::GridLayout::USE_PREF, 0, 0); |
| 120 | 119 |
| 121 layout->StartRow(0, kHeaderColumnSetId); | 120 layout->StartRow(0, kHeaderColumnSetId); |
| 122 layout->AddView(create_shortcuts_label_); | 121 layout->AddView(create_shortcuts_label_); |
| 123 | 122 |
| 124 layout->AddPaddingRow(0, views::kLabelToControlVerticalSpacing); | 123 layout->AddPaddingRow(0, provider->GetDistanceMetric( |
| 124 views::DISTANCE_RELATED_CONTROL_VERTICAL)); |
| 125 layout->StartRow(0, kTableColumnSetId); | 125 layout->StartRow(0, kTableColumnSetId); |
| 126 layout->AddView(desktop_check_box_); | 126 layout->AddView(desktop_check_box_); |
| 127 | 127 |
| 128 const int vertical_spacing = | 128 const int vertical_spacing = |
| 129 provider->GetDistanceMetric(DISTANCE_RELATED_CONTROL_VERTICAL_SMALL); | 129 provider->GetDistanceMetric(DISTANCE_RELATED_CONTROL_VERTICAL_SMALL); |
| 130 if (menu_check_box_ != nullptr) { | 130 if (menu_check_box_ != nullptr) { |
| 131 layout->AddPaddingRow(0, vertical_spacing); | 131 layout->AddPaddingRow(0, vertical_spacing); |
| 132 layout->StartRow(0, kTableColumnSetId); | 132 layout->StartRow(0, kTableColumnSetId); |
| 133 layout->AddView(menu_check_box_); | 133 layout->AddView(menu_check_box_); |
| 134 } | 134 } |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 views::Checkbox* checkbox = new views::Checkbox(text); | 239 views::Checkbox* checkbox = new views::Checkbox(text); |
| 240 checkbox->SetChecked(checked); | 240 checkbox->SetChecked(checked); |
| 241 checkbox->set_listener(this); | 241 checkbox->set_listener(this); |
| 242 return checkbox; | 242 return checkbox; |
| 243 } | 243 } |
| 244 | 244 |
| 245 void CreateChromeApplicationShortcutView::OnAppInfoLoaded( | 245 void CreateChromeApplicationShortcutView::OnAppInfoLoaded( |
| 246 std::unique_ptr<web_app::ShortcutInfo> shortcut_info) { | 246 std::unique_ptr<web_app::ShortcutInfo> shortcut_info) { |
| 247 shortcut_info_ = std::move(shortcut_info); | 247 shortcut_info_ = std::move(shortcut_info); |
| 248 } | 248 } |
| OLD | NEW |