| 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 "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/ui/views/constrained_window_views.h" | |
| 9 #include "components/web_modal/web_contents_modal_dialog_host.h" | 8 #include "components/web_modal/web_contents_modal_dialog_host.h" |
| 10 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 9 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 11 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" | 10 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" |
| 12 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
| 13 #include "grit/generated_resources.h" | 12 #include "grit/generated_resources.h" |
| 14 #include "grit/locale_settings.h" | 13 #include "grit/locale_settings.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/native_theme/native_theme.h" | 16 #include "ui/native_theme/native_theme.h" |
| 18 #include "ui/views/border.h" | 17 #include "ui/views/border.h" |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 bool MediaGalleriesDialogViews::Cancel() { | 309 bool MediaGalleriesDialogViews::Cancel() { |
| 311 return true; | 310 return true; |
| 312 } | 311 } |
| 313 | 312 |
| 314 bool MediaGalleriesDialogViews::Accept() { | 313 bool MediaGalleriesDialogViews::Accept() { |
| 315 accepted_ = true; | 314 accepted_ = true; |
| 316 | 315 |
| 317 return true; | 316 return true; |
| 318 } | 317 } |
| 319 | 318 |
| 320 // TODO(wittman): Remove this override once we move to the new style frame view | |
| 321 // on all dialogs. | |
| 322 views::NonClientFrameView* MediaGalleriesDialogViews::CreateNonClientFrameView( | |
| 323 views::Widget* widget) { | |
| 324 return CreateConstrainedStyleNonClientFrameView( | |
| 325 widget, | |
| 326 controller_->web_contents()->GetBrowserContext()); | |
| 327 } | |
| 328 | |
| 329 void MediaGalleriesDialogViews::ButtonPressed(views::Button* sender, | 319 void MediaGalleriesDialogViews::ButtonPressed(views::Button* sender, |
| 330 const ui::Event& event) { | 320 const ui::Event& event) { |
| 331 confirm_available_ = true; | 321 confirm_available_ = true; |
| 332 GetWidget()->client_view()->AsDialogClientView()->UpdateDialogButtons(); | 322 GetWidget()->client_view()->AsDialogClientView()->UpdateDialogButtons(); |
| 333 | 323 |
| 334 if (sender == add_gallery_button_) { | 324 if (sender == add_gallery_button_) { |
| 335 controller_->OnAddFolderClicked(); | 325 controller_->OnAddFolderClicked(); |
| 336 return; | 326 return; |
| 337 } | 327 } |
| 338 | 328 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 } | 370 } |
| 381 } | 371 } |
| 382 | 372 |
| 383 // MediaGalleriesDialogViewsController ----------------------------------------- | 373 // MediaGalleriesDialogViewsController ----------------------------------------- |
| 384 | 374 |
| 385 // static | 375 // static |
| 386 MediaGalleriesDialog* MediaGalleriesDialog::Create( | 376 MediaGalleriesDialog* MediaGalleriesDialog::Create( |
| 387 MediaGalleriesDialogController* controller) { | 377 MediaGalleriesDialogController* controller) { |
| 388 return new MediaGalleriesDialogViews(controller); | 378 return new MediaGalleriesDialogViews(controller); |
| 389 } | 379 } |
| OLD | NEW |