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 #ifndef CHROME_BROWSER_UI_VIEWS_USER_DATA_DIR_DIALOG_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_USER_DATA_DIR_DIALOG_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_USER_DATA_DIR_DIALOG_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_USER_DATA_DIR_DIALOG_VIEW_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "ui/shell_dialogs/select_file_dialog.h" | 12 #include "ui/shell_dialogs/select_file_dialog.h" |
13 #include "ui/views/window/dialog_delegate.h" | 13 #include "ui/views/window/dialog_delegate.h" |
14 | 14 |
15 namespace views { | 15 namespace views { |
16 class MessageBoxView; | 16 class MessageBoxView; |
17 } | 17 } |
18 | 18 |
19 // A dialog box that tells the user that we can't write to the specified user | 19 // A dialog box that tells the user that we can't write to the specified user |
20 // data directory. Provides the user a chance to pick a different directory. | 20 // data directory. Provides the user a chance to pick a different directory. |
21 class UserDataDirDialogView : public views::DialogDelegate, | 21 class UserDataDirDialogView : public views::DialogDelegate, |
22 public MessageLoopForUI::Dispatcher, | 22 public base::MessageLoopForUI::Dispatcher, |
23 public ui::SelectFileDialog::Listener { | 23 public ui::SelectFileDialog::Listener { |
24 public: | 24 public: |
25 explicit UserDataDirDialogView(const base::FilePath& user_data_dir); | 25 explicit UserDataDirDialogView(const base::FilePath& user_data_dir); |
26 virtual ~UserDataDirDialogView(); | 26 virtual ~UserDataDirDialogView(); |
27 | 27 |
28 base::FilePath user_data_dir() const { return user_data_dir_; } | 28 base::FilePath user_data_dir() const { return user_data_dir_; } |
29 | 29 |
30 // Overridden from views::DialogDelegate: | 30 // Overridden from views::DialogDelegate: |
31 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; | 31 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; |
32 virtual string16 GetWindowTitle() const OVERRIDE; | 32 virtual string16 GetWindowTitle() const OVERRIDE; |
(...skipping 23 matching lines...) Expand all Loading... |
56 scoped_refptr<ui::SelectFileDialog> select_file_dialog_; | 56 scoped_refptr<ui::SelectFileDialog> select_file_dialog_; |
57 | 57 |
58 // Used to keep track of whether or not to block the message loop (still | 58 // Used to keep track of whether or not to block the message loop (still |
59 // waiting for the user to dismiss the dialog). | 59 // waiting for the user to dismiss the dialog). |
60 bool is_blocking_; | 60 bool is_blocking_; |
61 | 61 |
62 DISALLOW_COPY_AND_ASSIGN(UserDataDirDialogView); | 62 DISALLOW_COPY_AND_ASSIGN(UserDataDirDialogView); |
63 }; | 63 }; |
64 | 64 |
65 #endif // CHROME_BROWSER_UI_VIEWS_USER_DATA_DIR_DIALOG_VIEW_H_ | 65 #endif // CHROME_BROWSER_UI_VIEWS_USER_DATA_DIR_DIALOG_VIEW_H_ |
OLD | NEW |