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

Side by Side Diff: chrome/browser/accessibility/accessibility_extension_api.cc

Issue 211273007: Split InfoBarService core code into InfoBarManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + comments Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/android/tab_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/accessibility/accessibility_extension_api.h" 5 #include "chrome/browser/accessibility/accessibility_extension_api.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/accessibility/accessibility_extension_api_constants.h" 10 #include "chrome/browser/accessibility/accessibility_extension_api_constants.h"
11 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" 11 #include "chrome/browser/extensions/api/tabs/tabs_constants.h"
12 #include "chrome/browser/extensions/extension_service.h" 12 #include "chrome/browser/extensions/extension_service.h"
13 #include "chrome/browser/extensions/extension_tab_util.h" 13 #include "chrome/browser/extensions/extension_tab_util.h"
14 #include "chrome/browser/infobars/confirm_infobar_delegate.h" 14 #include "chrome/browser/infobars/confirm_infobar_delegate.h"
15 #include "chrome/browser/infobars/infobar.h" 15 #include "chrome/browser/infobars/infobar.h"
16 #include "chrome/browser/infobars/infobar_manager.h"
16 #include "chrome/browser/infobars/infobar_service.h" 17 #include "chrome/browser/infobars/infobar_service.h"
17 #include "chrome/browser/profiles/profile.h" 18 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/common/extensions/api/experimental_accessibility.h" 19 #include "chrome/common/extensions/api/experimental_accessibility.h"
19 #include "content/public/browser/browser_accessibility_state.h" 20 #include "content/public/browser/browser_accessibility_state.h"
20 #include "extensions/browser/event_router.h" 21 #include "extensions/browser/event_router.h"
21 #include "extensions/browser/extension_host.h" 22 #include "extensions/browser/extension_host.h"
22 #include "extensions/browser/extension_system.h" 23 #include "extensions/browser/extension_system.h"
23 #include "extensions/browser/lazy_background_task_queue.h" 24 #include "extensions/browser/lazy_background_task_queue.h"
24 #include "extensions/common/error_utils.h" 25 #include "extensions/common/error_utils.h"
25 #include "extensions/common/manifest_handlers/background_info.h" 26 #include "extensions/common/manifest_handlers/background_info.h"
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 &contents, 268 &contents,
268 &tab_index)) { 269 &tab_index)) {
269 error_ = extensions::ErrorUtils::FormatErrorMessage( 270 error_ = extensions::ErrorUtils::FormatErrorMessage(
270 extensions::tabs_constants::kTabNotFoundError, 271 extensions::tabs_constants::kTabNotFoundError,
271 base::IntToString(tab_id)); 272 base::IntToString(tab_id));
272 return false; 273 return false;
273 } 274 }
274 275
275 base::ListValue* alerts_value = new base::ListValue; 276 base::ListValue* alerts_value = new base::ListValue;
276 277
277 InfoBarService* infobar_service = InfoBarService::FromWebContents(contents); 278 InfoBarManager* infobar_manager =
278 for (size_t i = 0; i < infobar_service->infobar_count(); ++i) { 279 InfoBarService::FromWebContents(contents)->infobar_manager();
280 for (size_t i = 0; i < infobar_manager->infobar_count(); ++i) {
279 // TODO(hashimoto): Make other kind of alerts available. crosbug.com/24281 281 // TODO(hashimoto): Make other kind of alerts available. crosbug.com/24281
280 ConfirmInfoBarDelegate* confirm_infobar_delegate = 282 ConfirmInfoBarDelegate* confirm_infobar_delegate =
281 infobar_service->infobar_at(i)->delegate()->AsConfirmInfoBarDelegate(); 283 infobar_manager->infobar_at(i)->delegate()->AsConfirmInfoBarDelegate();
282 if (confirm_infobar_delegate) { 284 if (confirm_infobar_delegate) {
283 base::DictionaryValue* alert_value = new base::DictionaryValue; 285 base::DictionaryValue* alert_value = new base::DictionaryValue;
284 const base::string16 message_text = 286 const base::string16 message_text =
285 confirm_infobar_delegate->GetMessageText(); 287 confirm_infobar_delegate->GetMessageText();
286 alert_value->SetString(keys::kMessageKey, message_text); 288 alert_value->SetString(keys::kMessageKey, message_text);
287 alerts_value->Append(alert_value); 289 alerts_value->Append(alert_value);
288 } 290 }
289 } 291 }
290 292
291 SetResult(alerts_value); 293 SetResult(alerts_value);
292 return true; 294 return true;
293 } 295 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/tab_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698