| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_scan_result_dialog_
views.h" | 5 #include "chrome/browser/ui/views/extensions/media_galleries_scan_result_dialog_
views.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/views/constrained_window_views.h" | |
| 8 #include "components/web_modal/web_contents_modal_dialog_host.h" | 7 #include "components/web_modal/web_contents_modal_dialog_host.h" |
| 9 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 8 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 10 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" | 9 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" |
| 11 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
| 12 #include "grit/generated_resources.h" | 11 #include "grit/generated_resources.h" |
| 13 #include "grit/locale_settings.h" | 12 #include "grit/locale_settings.h" |
| 14 #include "grit/ui_resources.h" | 13 #include "grit/ui_resources.h" |
| 15 #include "third_party/skia/include/core/SkColor.h" | 14 #include "third_party/skia/include/core/SkColor.h" |
| 16 #include "ui/base/l10n/l10n_util.h" | 15 #include "ui/base/l10n/l10n_util.h" |
| 17 #include "ui/base/resource/resource_bundle.h" | 16 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 bool MediaGalleriesScanResultDialogViews::Cancel() { | 266 bool MediaGalleriesScanResultDialogViews::Cancel() { |
| 268 return true; | 267 return true; |
| 269 } | 268 } |
| 270 | 269 |
| 271 bool MediaGalleriesScanResultDialogViews::Accept() { | 270 bool MediaGalleriesScanResultDialogViews::Accept() { |
| 272 accepted_ = true; | 271 accepted_ = true; |
| 273 | 272 |
| 274 return true; | 273 return true; |
| 275 } | 274 } |
| 276 | 275 |
| 277 // TODO(wittman): Remove this override once we move to the new style frame view | |
| 278 // on all dialogs. | |
| 279 views::NonClientFrameView* | |
| 280 MediaGalleriesScanResultDialogViews::CreateNonClientFrameView( | |
| 281 views::Widget* widget) { | |
| 282 return CreateConstrainedStyleNonClientFrameView( | |
| 283 widget, | |
| 284 controller_->web_contents()->GetBrowserContext()); | |
| 285 } | |
| 286 | |
| 287 void MediaGalleriesScanResultDialogViews::ButtonPressed( | 276 void MediaGalleriesScanResultDialogViews::ButtonPressed( |
| 288 views::Button* sender, | 277 views::Button* sender, |
| 289 const ui::Event& event) { | 278 const ui::Event& event) { |
| 290 GetWidget()->client_view()->AsDialogClientView()->UpdateDialogButtons(); | 279 GetWidget()->client_view()->AsDialogClientView()->UpdateDialogButtons(); |
| 291 | 280 |
| 292 for (GalleryViewMap::const_iterator it = gallery_view_map_.begin(); | 281 for (GalleryViewMap::const_iterator it = gallery_view_map_.begin(); |
| 293 it != gallery_view_map_.end(); ++it) { | 282 it != gallery_view_map_.end(); ++it) { |
| 294 if (sender == it->second.checkbox) { | 283 if (sender == it->second.checkbox) { |
| 295 controller_->DidToggleGalleryId(it->first, | 284 controller_->DidToggleGalleryId(it->first, |
| 296 it->second.checkbox->checked()); | 285 it->second.checkbox->checked()); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 } | 322 } |
| 334 } | 323 } |
| 335 | 324 |
| 336 // MediaGalleriesScanResultDialogViewsController ------------------------------- | 325 // MediaGalleriesScanResultDialogViewsController ------------------------------- |
| 337 | 326 |
| 338 // static | 327 // static |
| 339 MediaGalleriesScanResultDialog* MediaGalleriesScanResultDialog::Create( | 328 MediaGalleriesScanResultDialog* MediaGalleriesScanResultDialog::Create( |
| 340 MediaGalleriesScanResultDialogController* controller) { | 329 MediaGalleriesScanResultDialogController* controller) { |
| 341 return new MediaGalleriesScanResultDialogViews(controller); | 330 return new MediaGalleriesScanResultDialogViews(controller); |
| 342 } | 331 } |
| OLD | NEW |