-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VR: Prompt user to update their keyboard version if needed
This CL renames AudioPermissionPrompt and its corresponding texture to Prompt and uses the same texture for the exit prompt. Bug: 799584 Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_vr;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Change-Id: If435488f3e10a2f704d7e4df2177756e4d7aaa15 Reviewed-on: https://chromium-review.googlesource.com/945110 Commit-Queue: Yash Malik <ymalik@chromium.org> Reviewed-by: Christopher Grant <cjgrant@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#540573}(cherry picked from commit dd8e1f5) Reviewed-on: https://chromium-review.googlesource.com/952745 Reviewed-by: Yash Malik <ymalik@chromium.org> Cr-Commit-Position: refs/branch-heads/3359@{#53} Cr-Branched-From: 66afc5e-refs/heads/master@{#540276}
- Loading branch information
Yash Malik
authored and
Yash Malik
committed
Mar 7, 2018
1 parent
869f88f
commit af670aa
Showing
21 changed files
with
340 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
chrome/browser/vr/elements/audio_permission_prompt_texture.h
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright 2017 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "chrome/browser/vr/elements/prompt.h" | ||
|
||
#include "chrome/browser/vr/elements/prompt_texture.h" | ||
|
||
namespace vr { | ||
|
||
Prompt::Prompt(int preferred_width, | ||
int content_message_id, | ||
const gfx::VectorIcon& icon, | ||
int primary_button_message_id, | ||
int secondary_button_message_id, | ||
const ExitPromptCallback& result_callback) | ||
: ExitPrompt(preferred_width, | ||
result_callback, | ||
std::make_unique<PromptTexture>(content_message_id, | ||
icon, | ||
primary_button_message_id, | ||
secondary_button_message_id)) { | ||
set_reason(UiUnsupportedMode::kVoiceSearchNeedsRecordAudioOsPermission); | ||
} | ||
|
||
Prompt::~Prompt() = default; | ||
|
||
void Prompt::SetIconColor(SkColor color) { | ||
static_cast<PromptTexture*>(GetTexture())->SetIconColor(color); | ||
} | ||
|
||
} // namespace vr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright 2017 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CHROME_BROWSER_VR_ELEMENTS_PROMPT_H_ | ||
#define CHROME_BROWSER_VR_ELEMENTS_PROMPT_H_ | ||
|
||
#include <memory> | ||
|
||
#include "base/callback.h" | ||
#include "base/macros.h" | ||
#include "chrome/browser/vr/elements/exit_prompt.h" | ||
#include "ui/gfx/vector_icon_types.h" | ||
|
||
namespace vr { | ||
|
||
class Prompt : public ExitPrompt { | ||
public: | ||
Prompt(int preferred_width, | ||
int content_message_id, | ||
const gfx::VectorIcon& icon, | ||
int primary_button_message_id, | ||
int secondary_button_message_id, | ||
const ExitPromptCallback& result_callback); | ||
~Prompt() override; | ||
|
||
void SetIconColor(SkColor color); | ||
|
||
private: | ||
void OnStateUpdated(const gfx::PointF& position); | ||
|
||
DISALLOW_COPY_AND_ASSIGN(Prompt); | ||
}; | ||
|
||
} // namespace vr | ||
|
||
#endif // CHROME_BROWSER_VR_ELEMENTS_PROMPT_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright 2017 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CHROME_BROWSER_VR_ELEMENTS_PROMPT_TEXTURE_H_ | ||
#define CHROME_BROWSER_VR_ELEMENTS_PROMPT_TEXTURE_H_ | ||
|
||
#include "base/macros.h" | ||
#include "chrome/browser/vr/elements/exit_prompt_texture.h" | ||
#include "chrome/browser/vr/model/color_scheme.h" | ||
#include "ui/gfx/geometry/rect_f.h" | ||
#include "ui/gfx/vector_icon_types.h" | ||
|
||
namespace vr { | ||
|
||
class PromptTexture : public ExitPromptTexture { | ||
public: | ||
PromptTexture(int content_message_id, | ||
const gfx::VectorIcon& icon, | ||
int primary_button_message_id, | ||
int secondary_button_message_id); | ||
~PromptTexture() override; | ||
gfx::Size GetPreferredTextureSize(int width) const override; | ||
|
||
void SetIconColor(SkColor color); | ||
|
||
private: | ||
void Draw(SkCanvas* sk_canvas, const gfx::Size& texture_size) override; | ||
|
||
SkColor icon_color_ = SK_ColorBLACK; | ||
const gfx::VectorIcon& icon_; | ||
int primary_button_message_id_ = -1; | ||
int secondary_button_message_id_ = -1; | ||
|
||
DISALLOW_COPY_AND_ASSIGN(PromptTexture); | ||
}; | ||
|
||
} // namespace vr | ||
|
||
#endif // CHROME_BROWSER_VR_ELEMENTS_PROMPT_TEXTURE_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.