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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 public: | 131 public: |
132 DevToolsConfirmInfoBarDelegate( | 132 DevToolsConfirmInfoBarDelegate( |
133 InfoBarService* infobar_service, | 133 InfoBarService* infobar_service, |
134 const ConfirmInfoBarCallback& callback, | 134 const ConfirmInfoBarCallback& callback, |
135 string16 message) | 135 string16 message) |
136 : ConfirmInfoBarDelegate(infobar_service), | 136 : ConfirmInfoBarDelegate(infobar_service), |
137 callback_(callback), | 137 callback_(callback), |
138 message_(message) { | 138 message_(message) { |
139 } | 139 } |
140 | 140 |
141 virtual string16 GetMessageText() const { | 141 virtual string16 GetMessageText() const OVERRIDE { return message_; } |
142 return message_; | |
143 } | |
144 | 142 |
145 virtual bool Accept() { | 143 virtual bool Accept() OVERRIDE { |
146 callback_.Run(true); | 144 callback_.Run(true); |
147 callback_.Reset(); | 145 callback_.Reset(); |
148 return true; | 146 return true; |
149 } | 147 } |
150 | 148 |
151 virtual bool Cancel() { | 149 virtual bool Cancel() OVERRIDE { |
152 callback_.Run(false); | 150 callback_.Run(false); |
153 callback_.Reset(); | 151 callback_.Reset(); |
154 return true; | 152 return true; |
155 } | 153 } |
156 | 154 |
157 string16 GetButtonLabel(InfoBarButton button) const { | 155 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE { |
158 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? | 156 return l10n_util::GetStringUTF16((button == BUTTON_OK) |
159 IDS_DEV_TOOLS_CONFIRM_ALLOW_BUTTON : | 157 ? IDS_DEV_TOOLS_CONFIRM_ALLOW_BUTTON |
160 IDS_DEV_TOOLS_CONFIRM_DENY_BUTTON); | 158 : IDS_DEV_TOOLS_CONFIRM_DENY_BUTTON); |
161 } | 159 } |
162 | 160 |
163 private: | 161 private: |
164 virtual ~DevToolsConfirmInfoBarDelegate() { | 162 virtual ~DevToolsConfirmInfoBarDelegate() { |
165 if (!callback_.is_null()) { | 163 if (!callback_.is_null()) { |
166 callback_.Run(false); | 164 callback_.Run(false); |
167 } | 165 } |
168 } | 166 } |
169 | 167 |
170 ConfirmInfoBarCallback callback_; | 168 ConfirmInfoBarCallback callback_; |
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1168 DevToolsDockSide DevToolsWindow::SideFromString( | 1166 DevToolsDockSide DevToolsWindow::SideFromString( |
1169 const std::string& dock_side) { | 1167 const std::string& dock_side) { |
1170 if (dock_side == kDockSideRight) | 1168 if (dock_side == kDockSideRight) |
1171 return DEVTOOLS_DOCK_SIDE_RIGHT; | 1169 return DEVTOOLS_DOCK_SIDE_RIGHT; |
1172 if (dock_side == kDockSideBottom) | 1170 if (dock_side == kDockSideBottom) |
1173 return DEVTOOLS_DOCK_SIDE_BOTTOM; | 1171 return DEVTOOLS_DOCK_SIDE_BOTTOM; |
1174 if (dock_side == kDockSideMinimized) | 1172 if (dock_side == kDockSideMinimized) |
1175 return DEVTOOLS_DOCK_SIDE_MINIMIZED; | 1173 return DEVTOOLS_DOCK_SIDE_MINIMIZED; |
1176 return DEVTOOLS_DOCK_SIDE_UNDOCKED; | 1174 return DEVTOOLS_DOCK_SIDE_UNDOCKED; |
1177 } | 1175 } |
OLD | NEW |