| 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/extensions/media_galleries_dialog_views.h" | 5 #include "chrome/browser/ui/views/extensions/media_galleries_dialog_views.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "chrome/browser/ui/views/extensions/media_gallery_checkbox_view.h" | 11 #include "chrome/browser/ui/views/extensions/media_gallery_checkbox_view.h" |
| 12 #include "chrome/grit/generated_resources.h" | 12 #include "chrome/grit/generated_resources.h" |
| 13 #include "chrome/grit/locale_settings.h" | 13 #include "chrome/grit/locale_settings.h" |
| 14 #include "components/constrained_window/constrained_window_views.h" | 14 #include "components/constrained_window/constrained_window_views.h" |
| 15 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 15 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 16 #include "content/public/browser/web_contents.h" | 16 #include "content/public/browser/web_contents.h" |
| 17 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
| 18 #include "ui/native_theme/native_theme.h" | 18 #include "ui/native_theme/native_theme.h" |
| 19 #include "ui/views/border.h" | 19 #include "ui/views/border.h" |
| 20 #include "ui/views/controls/button/checkbox.h" | 20 #include "ui/views/controls/button/checkbox.h" |
| 21 #include "ui/views/controls/button/image_button.h" | 21 #include "ui/views/controls/button/image_button.h" |
| 22 #include "ui/views/controls/button/label_button.h" | 22 #include "ui/views/controls/button/md_text_button.h" |
| 23 #include "ui/views/controls/label.h" | 23 #include "ui/views/controls/label.h" |
| 24 #include "ui/views/controls/menu/menu_runner.h" | 24 #include "ui/views/controls/menu/menu_runner.h" |
| 25 #include "ui/views/controls/scroll_view.h" | 25 #include "ui/views/controls/scroll_view.h" |
| 26 #include "ui/views/controls/separator.h" | 26 #include "ui/views/controls/separator.h" |
| 27 #include "ui/views/layout/box_layout.h" | 27 #include "ui/views/layout/box_layout.h" |
| 28 #include "ui/views/layout/grid_layout.h" | 28 #include "ui/views/layout/grid_layout.h" |
| 29 #include "ui/views/layout/layout_constants.h" | 29 #include "ui/views/layout/layout_constants.h" |
| 30 #include "ui/views/view.h" | 30 #include "ui/views/view.h" |
| 31 #include "ui/views/widget/widget.h" | 31 #include "ui/views/widget/widget.h" |
| 32 #include "ui/views/window/dialog_client_view.h" | 32 #include "ui/views/window/dialog_client_view.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 } | 245 } |
| 246 | 246 |
| 247 ui::ModalType MediaGalleriesDialogViews::GetModalType() const { | 247 ui::ModalType MediaGalleriesDialogViews::GetModalType() const { |
| 248 return ui::MODAL_TYPE_CHILD; | 248 return ui::MODAL_TYPE_CHILD; |
| 249 } | 249 } |
| 250 | 250 |
| 251 views::View* MediaGalleriesDialogViews::CreateExtraView() { | 251 views::View* MediaGalleriesDialogViews::CreateExtraView() { |
| 252 DCHECK(!auxiliary_button_); | 252 DCHECK(!auxiliary_button_); |
| 253 base::string16 button_label = controller_->GetAuxiliaryButtonText(); | 253 base::string16 button_label = controller_->GetAuxiliaryButtonText(); |
| 254 if (!button_label.empty()) { | 254 if (!button_label.empty()) { |
| 255 auxiliary_button_ = new views::LabelButton(this, button_label); | 255 auxiliary_button_ = |
| 256 auxiliary_button_->SetStyle(views::Button::STYLE_BUTTON); | 256 views::MdTextButton::CreateSecondaryUiButton(this, button_label); |
| 257 } | 257 } |
| 258 return auxiliary_button_; | 258 return auxiliary_button_; |
| 259 } | 259 } |
| 260 | 260 |
| 261 bool MediaGalleriesDialogViews::Cancel() { | 261 bool MediaGalleriesDialogViews::Cancel() { |
| 262 return true; | 262 return true; |
| 263 } | 263 } |
| 264 | 264 |
| 265 bool MediaGalleriesDialogViews::Accept() { | 265 bool MediaGalleriesDialogViews::Accept() { |
| 266 accepted_ = true; | 266 accepted_ = true; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 return controller_->WebContents() != NULL; | 323 return controller_->WebContents() != NULL; |
| 324 } | 324 } |
| 325 | 325 |
| 326 // MediaGalleriesDialogViewsController ----------------------------------------- | 326 // MediaGalleriesDialogViewsController ----------------------------------------- |
| 327 | 327 |
| 328 // static | 328 // static |
| 329 MediaGalleriesDialog* MediaGalleriesDialog::Create( | 329 MediaGalleriesDialog* MediaGalleriesDialog::Create( |
| 330 MediaGalleriesDialogController* controller) { | 330 MediaGalleriesDialogController* controller) { |
| 331 return new MediaGalleriesDialogViews(controller); | 331 return new MediaGalleriesDialogViews(controller); |
| 332 } | 332 } |
| OLD | NEW |