| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/window/dialog_client_view.h" | 5 #include "views/window/dialog_client_view.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <uxtheme.h> | 9 #include <uxtheme.h> |
| 10 #include <vsstyle.h> | 10 #include <vsstyle.h> |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 size_extra_view_height_to_buttons_ = | 534 size_extra_view_height_to_buttons_ = |
| 535 GetDialogDelegate()->GetSizeExtraViewHeightToButtons(); | 535 GetDialogDelegate()->GetSizeExtraViewHeightToButtons(); |
| 536 } | 536 } |
| 537 } | 537 } |
| 538 | 538 |
| 539 DialogDelegate* DialogClientView::GetDialogDelegate() const { | 539 DialogDelegate* DialogClientView::GetDialogDelegate() const { |
| 540 return window()->window_delegate()->AsDialogDelegate(); | 540 return window()->window_delegate()->AsDialogDelegate(); |
| 541 } | 541 } |
| 542 | 542 |
| 543 void DialogClientView::Close() { | 543 void DialogClientView::Close() { |
| 544 window()->CloseWindow(); | 544 window()->Close(); |
| 545 GetDialogDelegate()->OnClose(); | 545 GetDialogDelegate()->OnClose(); |
| 546 } | 546 } |
| 547 | 547 |
| 548 void DialogClientView::UpdateFocusListener() { | 548 void DialogClientView::UpdateFocusListener() { |
| 549 FocusManager* focus_manager = GetFocusManager(); | 549 FocusManager* focus_manager = GetFocusManager(); |
| 550 // Listen for focus change events so we can update the default button. | 550 // Listen for focus change events so we can update the default button. |
| 551 // focus_manager can be NULL when the dialog is created on un-shown view. | 551 // focus_manager can be NULL when the dialog is created on un-shown view. |
| 552 // We start listening for focus changes when the page is visible. | 552 // We start listening for focus changes when the page is visible. |
| 553 // Focus manager could also change if window host changes a parent. | 553 // Focus manager could also change if window host changes a parent. |
| 554 if (listening_to_focus_) { | 554 if (listening_to_focus_) { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 571 void DialogClientView::InitClass() { | 571 void DialogClientView::InitClass() { |
| 572 static bool initialized = false; | 572 static bool initialized = false; |
| 573 if (!initialized) { | 573 if (!initialized) { |
| 574 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 574 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 575 dialog_button_font_ = new gfx::Font(rb.GetFont(ResourceBundle::BaseFont)); | 575 dialog_button_font_ = new gfx::Font(rb.GetFont(ResourceBundle::BaseFont)); |
| 576 initialized = true; | 576 initialized = true; |
| 577 } | 577 } |
| 578 } | 578 } |
| 579 | 579 |
| 580 } // namespace views | 580 } // namespace views |
| OLD | NEW |