OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/views/new_profile_dialog.h" | 5 #include "chrome/browser/views/new_profile_dialog.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 message_box_view_->text_box()->SetController(this); | 43 message_box_view_->text_box()->SetController(this); |
44 } | 44 } |
45 | 45 |
46 NewProfileDialog::~NewProfileDialog() { | 46 NewProfileDialog::~NewProfileDialog() { |
47 } | 47 } |
48 | 48 |
49 int NewProfileDialog::GetDialogButtons() const { | 49 int NewProfileDialog::GetDialogButtons() const { |
50 return DIALOGBUTTON_OK | DIALOGBUTTON_CANCEL; | 50 return DIALOGBUTTON_OK | DIALOGBUTTON_CANCEL; |
51 } | 51 } |
52 | 52 |
53 views::View* NewProfileDialog::GetInitiallyFocusedView() const { | 53 views::View* NewProfileDialog::GetInitiallyFocusedView() { |
54 views::TextField* text_box = message_box_view_->text_box(); | 54 views::TextField* text_box = message_box_view_->text_box(); |
55 DCHECK(text_box); | 55 DCHECK(text_box); |
56 return text_box; | 56 return text_box; |
57 } | 57 } |
58 | 58 |
59 bool NewProfileDialog::IsDialogButtonEnabled( | 59 bool NewProfileDialog::IsDialogButtonEnabled( |
60 DialogButton button) const { | 60 DialogButton button) const { |
61 if (button == DIALOGBUTTON_OK) { | 61 if (button == DIALOGBUTTON_OK) { |
62 std::wstring profile_name = message_box_view_->GetInputText(); | 62 std::wstring profile_name = message_box_view_->GetInputText(); |
63 // TODO(munjal): Refactor the function ReplaceIllegalCharacters in | 63 // TODO(munjal): Refactor the function ReplaceIllegalCharacters in |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 UserDataManager::Get()->CreateDesktopShortcutForProfile( | 96 UserDataManager::Get()->CreateDesktopShortcutForProfile( |
97 profile_name); | 97 profile_name); |
98 | 98 |
99 UserDataManager::Get()->LaunchChromeForProfile(profile_name); | 99 UserDataManager::Get()->LaunchChromeForProfile(profile_name); |
100 return true; | 100 return true; |
101 } | 101 } |
102 | 102 |
103 views::View* NewProfileDialog::GetContentsView() { | 103 views::View* NewProfileDialog::GetContentsView() { |
104 return message_box_view_; | 104 return message_box_view_; |
105 } | 105 } |
OLD | NEW |