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/webui/constrained_web_dialog_ui.h" | 5 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 namespace { | 29 namespace { |
30 | 30 |
31 const char kConstrainedWebDialogDelegateUserDataKey[] = | 31 const char kConstrainedWebDialogDelegateUserDataKey[] = |
32 "ConstrainedWebDialogDelegateUserData"; | 32 "ConstrainedWebDialogDelegateUserData"; |
33 | 33 |
34 class ConstrainedWebDialogDelegateUserData | 34 class ConstrainedWebDialogDelegateUserData |
35 : public base::SupportsUserData::Data { | 35 : public base::SupportsUserData::Data { |
36 public: | 36 public: |
37 explicit ConstrainedWebDialogDelegateUserData( | 37 explicit ConstrainedWebDialogDelegateUserData( |
38 ConstrainedWebDialogDelegate* delegate) : delegate_(delegate) {} | 38 ConstrainedWebDialogDelegate* delegate) : delegate_(delegate) {} |
39 virtual ~ConstrainedWebDialogDelegateUserData() {} | 39 ~ConstrainedWebDialogDelegateUserData() override {} |
40 | 40 |
41 ConstrainedWebDialogDelegate* delegate() { return delegate_; } | 41 ConstrainedWebDialogDelegate* delegate() { return delegate_; } |
42 | 42 |
43 private: | 43 private: |
44 ConstrainedWebDialogDelegate* delegate_; // unowned | 44 ConstrainedWebDialogDelegate* delegate_; // unowned |
45 | 45 |
46 DISALLOW_COPY_AND_ASSIGN(ConstrainedWebDialogDelegateUserData); | 46 DISALLOW_COPY_AND_ASSIGN(ConstrainedWebDialogDelegateUserData); |
47 }; | 47 }; |
48 | 48 |
49 } // namespace | 49 } // namespace |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 } | 103 } |
104 | 104 |
105 ConstrainedWebDialogDelegate* ConstrainedWebDialogUI::GetConstrainedDelegate() { | 105 ConstrainedWebDialogDelegate* ConstrainedWebDialogUI::GetConstrainedDelegate() { |
106 ConstrainedWebDialogDelegateUserData* user_data = | 106 ConstrainedWebDialogDelegateUserData* user_data = |
107 static_cast<ConstrainedWebDialogDelegateUserData*>( | 107 static_cast<ConstrainedWebDialogDelegateUserData*>( |
108 web_ui()->GetWebContents()-> | 108 web_ui()->GetWebContents()-> |
109 GetUserData(&kConstrainedWebDialogDelegateUserDataKey)); | 109 GetUserData(&kConstrainedWebDialogDelegateUserDataKey)); |
110 | 110 |
111 return user_data ? user_data->delegate() : NULL; | 111 return user_data ? user_data->delegate() : NULL; |
112 } | 112 } |
OLD | NEW |