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

Side by Side Diff: chrome/browser/extensions/api/automation_internal/automation_internal_api.cc

Issue 291453002: Make ExtensionFunction::ArgumentList (PKA MultipleArguments) take a scoped_ptr (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reabse Created 6 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/extensions/api/automation_internal/automation_internal_ api.h" 5 #include "chrome/browser/extensions/api/automation_internal/automation_internal_ api.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "chrome/browser/extensions/api/automation_internal/automation_util.h" 9 #include "chrome/browser/extensions/api/automation_internal/automation_util.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 content::WebContents* contents = 69 content::WebContents* contents =
70 tab_strip->GetWebContentsAt(tab_strip->active_index()); 70 tab_strip->GetWebContentsAt(tab_strip->active_index());
71 if (!contents) 71 if (!contents)
72 return RespondNow(Error("No active tab")); 72 return RespondNow(Error("No active tab"));
73 content::RenderWidgetHost* rwh = 73 content::RenderWidgetHost* rwh =
74 contents->GetRenderWidgetHostView()->GetRenderWidgetHost(); 74 contents->GetRenderWidgetHostView()->GetRenderWidgetHost();
75 if (!rwh) 75 if (!rwh)
76 return RespondNow(Error("Could not enable accessibility for active tab")); 76 return RespondNow(Error("Could not enable accessibility for active tab"));
77 AutomationWebContentsObserver::CreateForWebContents(contents); 77 AutomationWebContentsObserver::CreateForWebContents(contents);
78 rwh->EnableTreeOnlyAccessibilityMode(); 78 rwh->EnableTreeOnlyAccessibilityMode();
79 scoped_ptr<base::ListValue> results = 79 return RespondNow(
80 api::automation_internal::EnableCurrentTab::Results::Create( 80 ArgumentList(api::automation_internal::EnableCurrentTab::Results::Create(
81 rwh->GetProcess()->GetID(), rwh->GetRoutingID()); 81 rwh->GetProcess()->GetID(), rwh->GetRoutingID())));
82 return RespondNow(MultipleArguments(results.release()));
83 } 82 }
84 83
85 ExtensionFunction::ResponseAction 84 ExtensionFunction::ResponseAction
86 AutomationInternalPerformActionFunction::Run() { 85 AutomationInternalPerformActionFunction::Run() {
87 using api::automation_internal::PerformAction::Params; 86 using api::automation_internal::PerformAction::Params;
88 scoped_ptr<Params> params(Params::Create(*args_)); 87 scoped_ptr<Params> params(Params::Create(*args_));
89 EXTENSION_FUNCTION_VALIDATE(params.get()); 88 EXTENSION_FUNCTION_VALIDATE(params.get());
90 89
91 content::RenderWidgetHost* rwh = 90 content::RenderWidgetHost* rwh =
92 content::RenderWidgetHost::FromID(params->args.process_id, 91 content::RenderWidgetHost::FromID(params->args.process_id,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 return RespondNow(Error("desktop permission must be requested")); 126 return RespondNow(Error("desktop permission must be requested"));
128 127
129 AutomationManagerViews::GetInstance()->Enable(browser_context()); 128 AutomationManagerViews::GetInstance()->Enable(browser_context());
130 return RespondNow(NoArguments()); 129 return RespondNow(NoArguments());
131 #else 130 #else
132 return RespondNow(Error("getDesktop is unsupported by this platform")); 131 return RespondNow(Error("getDesktop is unsupported by this platform"));
133 #endif 132 #endif
134 } 133 }
135 134
136 } // namespace extensions 135 } // namespace extensions
OLDNEW
« no previous file with comments | « apps/shell/browser/api/shell/shell_api.cc ('k') | chrome/browser/extensions/api/identity/identity_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698