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

Unified Diff: chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_arc_home_service.cc

Issue 2952293002: add more information to voice interaction root node. (Closed)
Patch Set: address review comments Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_arc_home_service.cc
diff --git a/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_arc_home_service.cc b/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_arc_home_service.cc
index e62920061ce26e17c8b3d7a5798b1c19eea2ff60..0ab5ad13c7d037455937572375c7ded8f2465cf7 100644
--- a/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_arc_home_service.cc
+++ b/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_arc_home_service.cc
@@ -28,6 +28,7 @@
#include "ui/aura/window.h"
#include "ui/snapshot/snapshot.h"
#include "ui/wm/public/activation_client.h"
+#include "url/gurl.h"
namespace arc {
@@ -64,10 +65,17 @@ mojom::VoiceInteractionStructurePtr CreateVoiceInteractionStructure(
void RequestVoiceInteractionStructureCallback(
const base::Callback<void(mojom::VoiceInteractionStructurePtr)>& callback,
+ const gfx::Rect& bounds,
+ const std::string& web_url,
const ui::AXTreeUpdate& update) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- callback.Run(CreateVoiceInteractionStructure(
+ auto root = mojom::VoiceInteractionStructure::New();
+ root->rect = bounds;
+ root->class_name = "android.view.dummy.root.WebUrl";
+ root->text = base::UTF8ToUTF16(web_url);
+ root->children.push_back(CreateVoiceInteractionStructure(
*ui::AXSnapshotNodeAndroid::Create(update, false)));
+ callback.Run(std::move(root));
}
} // namespace
@@ -121,7 +129,9 @@ void ArcVoiceInteractionArcHomeService::GetVoiceInteractionStructure(
}
web_contents->RequestAXTreeSnapshot(
- base::Bind(&RequestVoiceInteractionStructureCallback, callback));
+ base::Bind(&RequestVoiceInteractionStructureCallback, callback,
+ browser->window()->GetBounds(),
+ web_contents->GetLastCommittedURL().spec()));
}
void ArcVoiceInteractionArcHomeService::OnVoiceInteractionOobeSetupComplete() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698