Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Side by Side Diff: chrome/browser/ui/views/extensions/request_file_system_dialog_view.h

Issue 2816293002: Description: Replace layout constants in chrome/browser/extensions and chrome/browser/first_run (Closed)
Patch Set: Update DEPS Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_EXTENSIONS_API_FILE_SYSTEM_REQUEST_FILE_SYSTEM_DIALOG_VIE W_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_REQUEST_FILE_SYSTEM_DIALOG_VIEW_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_REQUEST_FILE_SYSTEM_DIALOG_VIE W_H_ 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_REQUEST_FILE_SYSTEM_DIALOG_VIEW_H_
7 7
8 #include "base/callback_forward.h" 8 #include "base/callback_forward.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
11 #include "base/strings/string16.h" 11 #include "base/strings/string16.h"
12 #include "chrome/browser/chromeos/file_manager/volume_manager.h"
13 #include "extensions/common/extension.h"
14 #include "ui/base/ui_base_types.h" 12 #include "ui/base/ui_base_types.h"
15 #include "ui/views/window/dialog_delegate.h" 13 #include "ui/views/window/dialog_delegate.h"
16 14
17 namespace content { 15 namespace content {
18 class WebContents; 16 class WebContents;
19 } // namespace content 17 } // namespace content
20 18
21 namespace file_manager {
22 class Volume;
23 } // namespace file_manager
24
25 namespace views { 19 namespace views {
26 class View; 20 class View;
27 } // namespace views 21 } // namespace views
28 22
29 // Represents a dialog shown to a user for granting access to a file system. 23 // Represents a dialog shown to a user for granting access to a file system.
30 class RequestFileSystemDialogView : public views::DialogDelegate { 24 class RequestFileSystemDialogView : public views::DialogDelegateView {
31 public: 25 public:
32 ~RequestFileSystemDialogView() override; 26 ~RequestFileSystemDialogView() override;
33 27
34 // Shows the dialog and calls |callback| on completion. 28 // Shows the dialog and calls |callback| on completion.
35 static void ShowDialog( 29 static void ShowDialog(
36 content::WebContents* web_contents, 30 content::WebContents* web_contents,
37 const extensions::Extension& extension, 31 const std::string& extension_id,
38 base::WeakPtr<file_manager::Volume> volume, 32 const std::string volume_label,
33 const std::string& volume_id,
39 bool writable, 34 bool writable,
40 const base::Callback<void(ui::DialogButton)>& callback); 35 const base::Callback<void(ui::DialogButton)>& callback);
41 36
42 // views::DialogDelegate overrides: 37 // views::DialogDelegate overrides:
43 base::string16 GetAccessibleWindowTitle() const override; 38 base::string16 GetAccessibleWindowTitle() const override;
44 int GetDefaultDialogButton() const override; 39 int GetDefaultDialogButton() const override;
45 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; 40 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
46 ui::ModalType GetModalType() const override; 41 ui::ModalType GetModalType() const override;
47 views::View* GetContentsView() override;
48 views::Widget* GetWidget() override;
49 const views::Widget* GetWidget() const override;
50 bool Cancel() override; 42 bool Cancel() override;
51 bool Accept() override; 43 bool Accept() override;
44 gfx::Size GetPreferredSize() const override;
45 gfx::Insets GetInsets() const override;
52 46
53 private: 47 private:
54 RequestFileSystemDialogView( 48 RequestFileSystemDialogView(
55 const extensions::Extension& extension, 49 const std::string& extension_id,
56 base::WeakPtr<file_manager::Volume> volume, 50 const std::string volume_label,
51 const std::string& volume_id,
57 bool writable, 52 bool writable,
58 const base::Callback<void(ui::DialogButton)>& callback); 53 const base::Callback<void(ui::DialogButton)>& callback);
59 54
60 const base::Callback<void(ui::DialogButton)> callback_; 55 const base::Callback<void(ui::DialogButton)> callback_;
61 views::View* const contents_view_; 56 views::View* const contents_view_;
62 57
63 DISALLOW_COPY_AND_ASSIGN(RequestFileSystemDialogView); 58 DISALLOW_COPY_AND_ASSIGN(RequestFileSystemDialogView);
64 }; 59 };
65 60
66 #endif // CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_REQUEST_FILE_SYSTEM_DIALOG_ VIEW_H_ 61 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_REQUEST_FILE_SYSTEM_DIALOG_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698