//commented the code temporarily to fix the build error
#if defined(SAMSUNG_NEXT_BROWSER)
-/*
void Browser::DisplayQRCode(std::string contents) {
auto samsung_passkey_controller =
samsung_browser_main::SamsungBrowserCore::instance()->PasskeyController();
samsung_passkey_controller->CloseQRCode();
}
-*/
#endif // SAMSUNG_NEXT_BROWSER
void Browser::DraggableRegionsChanged(
const std::vector<blink::mojom::DraggableRegionPtr>& regions,
content::WebContents* contents) override;
#if defined(SAMSUNG_NEXT_BROWSER)
- //TODO:[NextBrowser][Merging]
-//commented the code temporarily to fix the build error
-
- //void DisplayQRCode(std::string contents) override;
- //void CloseQRCode() override;
+ void DisplayQRCode(std::string contents) override;
+ void CloseQRCode() override;
#endif // SAMSUNG_NEXT_BROWSER
bool is_type_normal() const { return type_ == TYPE_NORMAL; }
bool is_type_popup() const { return type_ == TYPE_POPUP; }
return;
}
void HighContrastController::SetContrastMode(bool value) {
- const base::flat_map<ui::NativeTheme::SystemThemeColor, uint32_t> dark_theme{
- {ui::NativeTheme::SystemThemeColor::kButtonFace, 0xFF000000},
- {ui::NativeTheme::SystemThemeColor::kButtonText, 0xFFFFFFFF},
- {ui::NativeTheme::SystemThemeColor::kGrayText, 0xFF3FF23F},
- {ui::NativeTheme::SystemThemeColor::kHighlight, 0xFF1AEBFF},
- {ui::NativeTheme::SystemThemeColor::kHighlightText, 0xFF000000},
- {ui::NativeTheme::SystemThemeColor::kHotlight, 0xFFFFFF00},
- {ui::NativeTheme::SystemThemeColor::kMenuHighlight, 0xFF800080},
- {ui::NativeTheme::SystemThemeColor::kScrollbar, 0xFF000000},
- {ui::NativeTheme::SystemThemeColor::kWindow, 0xFF000000},
- {ui::NativeTheme::SystemThemeColor::kWindowText, 0xFFFFFFFF},
- };
- const base::flat_map<ui::NativeTheme::SystemThemeColor, uint32_t> light_theme{
- {ui::NativeTheme::SystemThemeColor::kButtonFace, 0xFFFFFFFF},
- {ui::NativeTheme::SystemThemeColor::kButtonText, 0xFF000000},
- {ui::NativeTheme::SystemThemeColor::kGrayText, 0xFF600000},
- {ui::NativeTheme::SystemThemeColor::kHighlight, 0xFF37006E},
- {ui::NativeTheme::SystemThemeColor::kHighlightText, 0xFFFFFFFF},
- {ui::NativeTheme::SystemThemeColor::kHotlight, 0xFF00009F},
- {ui::NativeTheme::SystemThemeColor::kMenuHighlight, 0xFF000000},
- {ui::NativeTheme::SystemThemeColor::kScrollbar, 0xFFFFFFFF},
- {ui::NativeTheme::SystemThemeColor::kWindow, 0xFFFFFFFF},
- {ui::NativeTheme::SystemThemeColor::kWindowText, 0xFF000000},
- };
-
- auto native_theme_ = ui::NativeTheme::GetInstanceForNativeUi();
+ auto native_theme = ui::NativeTheme::GetInstanceForNativeUi();
if (value) {
- native_theme_->SetPreferredContrast(
+ native_theme->SetPreferredContrast(
ui::NativeTheme::PreferredContrast::kMore);
- //TODO:[NextBrowser][Merging]
- //commented the code temporarily to fix the build error
- //removed form NativeTheme
- //native_theme_->UpdateSystemColorInfo(true, true, dark_theme);
+ native_theme->set_use_dark_colors(true);
} else {
- native_theme_->SetPreferredContrast(
+ native_theme->SetPreferredContrast(
ui::NativeTheme::PreferredContrast::kNoPreference);
- // native_theme_->UpdateSystemColorInfo(false, false, light_theme);
+ native_theme->set_use_dark_colors(false);
}
- native_theme_->NotifyOnNativeThemeUpdated();
- native_theme_->NotifyOnPreferredContrastUpdated();
+ native_theme->NotifyOnNativeThemeUpdated();
+ native_theme->NotifyOnPreferredContrastUpdated();
is_active_ = value;
}
l10n_util::GetStringUTF16(IDS_ACCNAME_NEWTAB));
#if defined(SAMSUNG_TABSTRIP_UI)
- //TODO:[NextBrowser][Merging]
- //commented the code temporarily to fix the build error
-/*
- auto handoff_button = std::make_unique<HandOffButton>(
+ std::unique_ptr<HandOffButton> handoff_button = std::make_unique<HandOffButton>(
tab_strip_, base::BindRepeating(&TabStrip::HandOffButtonPressed,
base::Unretained(tab_strip_)));
handoff_button_ = AddChildView(std::move(handoff_button));
- */
#endif
// TODO(crbug.com/40118868): Revisit the macro expression once build flag
// switch of lacros-chrome is complete.
return !new_tab_button_->HitTestRect(get_target_rect(new_tab_button_));
}
#if defined(SAMSUNG_TABSTRIP_UI)
- //TODO:[NextBrowser][Merging]
- //commented the code temporarily to fix the build error
-/*
- if (render_new_tab_button_over_tab_strip_ && handoff_button_ &&
+ if (handoff_button_ &&
handoff_button_->GetLocalBounds().Intersects(
get_target_rect(handoff_button_))) {
return !handoff_button_->HitTestRect(get_target_rect(handoff_button_));
}
- */
#endif
if (render_tab_search_before_tab_strip_ && tab_search_container_ &&
children.emplace_back(new_tab_button_.get());
}
#if defined(SAMSUNG_TABSTRIP_UI)
- //TODO:[NextBrowser][Merging]
- //commented the code temporarily to fix the build error
- /* if (handoff_button_) {
+ if (handoff_button_) {
children.emplace_back(handoff_button_);
- }*/
+ }
#endif
if (tab_search_container_) {
children.emplace_back(tab_search_container_.get());
new_tab_button_->SetBorder(views::CreateEmptyBorder(border_insets));
}
#if defined(SAMSUNG_TABSTRIP_UI)
- //TODO:[NextBrowser][Merging]
- //commented the code temporarily to fix the build error
- /* if (handoff_button_) {
+ if (handoff_button_) {
handoff_button_->SetBorder(views::CreateEmptyBorder(border_insets));
- }*/
+ }
#endif
if (tab_search_container_) {
tab_search_container_->tab_search_button()->SetBorder(
}
#if defined(SAMSUNG_TABSTRIP_UI)
- //TODO:[NextBrowser][Merging]
- //commented the code temporarily to fix the build error
-/*
if (handoff_button_) {
- if (render_new_tab_button_over_tab_strip_) {
handoff_button_->SetPaintToLayer();
handoff_button_->layer()->SetFillsBoundsOpaquely(false);
// Inset between the tabstrip and new tab button should be reduced to
// account for extra spacing.
- layout_manager_->SetChildViewIgnoredByLayout(handoff_button_, true);
+ handoff_button_->SetProperty(views::kViewIgnoredByLayoutKey, true);
tab_strip_right_margin = handoff_button_->GetPreferredSize().width() +
GetLayoutConstant(TAB_STRIP_PADDING);
- }
}
- */
#endif
std::optional<int> tab_strip_left_margin;
if (tab_search_container_ && render_tab_search_before_tab_strip_) {
SetTitle(title);
SetMainImage(model);
SetHighlightedButton(highlighted_button);
- // make conditional
- std::u16string add_bookmarks =
- multi_language_controller->GetUTF16String("TV_SID_ADD_TO_BOOKMARKS");
- std::u16string remove_bookmarks = multi_language_controller->GetUTF16String(
- "TV_SID_REMOVE_FROM_BOOK_MARKS");
- if (already_bookmarked)
+ if (already_bookmarked) {
+ std::u16string remove_bookmarks = multi_language_controller->GetUTF16String(
+ "TV_SID_REMOVE_FROM_BOOK_MARKS");
SetButtonLabel(ui::mojom::DialogButton::kOk, remove_bookmarks);
- else
+ }
+ else {
+ std::u16string add_bookmarks =
+ multi_language_controller->GetUTF16String("TV_SID_ADD_TO_BOOKMARKS");
SetButtonLabel(ui::mojom::DialogButton::kOk, add_bookmarks);
+ }
SetAcceptCallback(
base::BindOnce(&SamsungBookmarksBubbleDialogView::BookmarkPressed,
SetShowCloseButton(true);
- //DialogDelegate::SetButtons(ui::mojom::DialogButton::kCancel | ui::mojom::DialogButton::kOk);
+ DialogDelegate::SetButtons(static_cast<int>(ui::mojom::DialogButton::kCancel) |
+ static_cast<int>(ui::mojom::DialogButton::kOk));
const views::LayoutProvider* provider = views::LayoutProvider::Get();
set_margins(provider->GetDialogInsetsForContentType(
if (already_bookmarked) {
title_->SetReadOnly(true);
- // take title from model
auto details = bookmark_controller->GetBookmarkInfo(GURL.spec());
title_->SetText(base::UTF8ToUTF16(details.first));
std::u16string yes = multi_language_controller->GetUTF16String("SID_YES");
std::u16string no = multi_language_controller->GetUTF16String("SID_NO");
- //TODO:[NextBrowser][Merging]
- //commented the code temporarily to fix the build error
- //SetButtonLabel(ui::mojom::DialogButton::kCancel, no);
- //SetButtonLabel(ui::mojom::DialogButton::kOk, yes);
- //SetDefaultButton(ui::mojom::DialogButton::kOk);
+ SetButtonLabel(ui::mojom::DialogButton::kCancel, no);
+ SetButtonLabel(ui::mojom::DialogButton::kOk, yes);
+ SetDefaultButton(static_cast<int>(ui::mojom::DialogButton::kOk));
- //DialogDelegate::SetButtons(ui::mojom::DialogButton::kOk | ui::mojom::DialogButton::kCancel);
+ DialogDelegate::SetButtons(static_cast<int>(ui::mojom::DialogButton::kOk) | static_cast<int>(ui::mojom::DialogButton::kCancel));
SetAcceptCallback(
base::BindOnce(&SamsungHandOffBubbleDialogView::YesButtonPressed,
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/tabs/tab_types.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
+#include "chrome/browser/ui/views/frame/top_container_background.h"
#include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h"
#include "chrome/browser/ui/views/tabs/tab_strip.h"
#include "chrome/grit/generated_resources.h"
// views::HighlightPathGenerator:
SkPath GetHighlightPath(const views::View* view) override {
return static_cast<const HandOffButton*>(view)->GetBorderPath(
- view->GetContentsBounds().origin(), 1.0f, false);
+ view->GetContentsBounds().origin(), false);
}
};
: views::ImageButton(std::move(callback)), tab_strip_(tab_strip) {
SetAnimateOnStateChange(true);
+ // If there is an image for the NewTabButton it is set by the theme. Theme
+ // images should not be flipped for RTL.
+ SetFlipCanvasOnPaintForRTLUI(false);
+
foreground_frame_active_color_id_ = kColorNewTabButtonForegroundFrameActive;
foreground_frame_inactive_color_id_ =
kColorNewTabButtonForegroundFrameInactive;
}
SkPath HandOffButton::GetBorderPath(const gfx::Point& origin,
- float scale,
bool extend_to_top) const {
- gfx::PointF scaled_origin(origin);
- scaled_origin.Scale(scale);
- const float radius = GetCornerRadius() * scale;
+ const float radius = GetCornerRadius();
SkPath path;
if (extend_to_top) {
- path.moveTo(scaled_origin.x(), 0);
+ path.moveTo(origin.x(), 0);
const float diameter = radius * 2;
path.rLineTo(diameter, 0);
- path.rLineTo(0, scaled_origin.y() + radius);
+ path.rLineTo(0, origin.y() + radius);
path.rArcTo(radius, radius, 0, SkPath::kSmall_ArcSize, SkPathDirection::kCW,
-diameter, 0);
path.close();
} else {
- path.addCircle(scaled_origin.x() + radius, scaled_origin.y() + radius,
- radius);
+ path.addCircle(origin.x() + radius, origin.y() + radius, radius);
}
return path;
}
PaintFill(canvas);
PaintIcon(canvas);
}
- //TODO:[NextBrowser][Merging]
- //commented the code temporarily to fix the build error
-/*
-gfx::Size HandOffButton::CalculatePreferredSize() const {
+
+gfx::Size HandOffButton::CalculatePreferredSize(const views::SizeBounds& available_size) const {
gfx::Size size = kButtonSize;
const auto insets = GetInsets();
size.Enlarge(insets.width(), insets.height());
return size;
-}*/
+}
bool HandOffButton::GetHitTestMask(SkPath* mask) const {
DCHECK(mask);
if (base::i18n::IsRTL())
origin.set_x(GetInsets().right());
const float scale = GetWidget()->GetCompositor()->device_scale_factor();
- SkPath border = GetBorderPath(origin, scale,
+ SkPath border = GetBorderPath(origin,
tab_strip_->controller()->IsFrameCondensed());
mask->addPath(border, SkMatrix::Scale(1 / scale, 1 / scale));
return true;
: background_frame_inactive_color_id_));
}
- canvas->DrawPath(GetBorderPath(gfx::Point(), scale, false), flags);
+ canvas->DrawPath(GetBorderPath(gfx::Point(), false), flags);
}
void HandOffButton::PaintIcon(gfx::Canvas* canvas) {
flags);
}
-//BEGIN_METADATA(HandOffButton, views::ImageButton)
-//END_METADATA
+BEGIN_METADATA(HandOffButton)
+END_METADATA
///////////////////////////////////////////////////////////////////////////////
class HandOffButton : public views::ImageButton,
public views::MaskedTargeterDelegate {
- public:
- METADATA_HEADER(HandOffButton,views::ImageButton);
+ METADATA_HEADER(HandOffButton, views::ImageButton)
+
+ public:
static const gfx::Size kButtonSize;
static const int kIconSize;
// Returns the path for the given |origin| and |scale|. If |extend_to_top| is
// true, the path is extended vertically to y = 0.
virtual SkPath GetBorderPath(const gfx::Point& origin,
- float scale,
bool extend_to_top) const;
// views::ImageButton:
void OnGestureEvent(ui::GestureEvent* event) override;
void NotifyClick(const ui::Event& event) override;
void PaintButtonContents(gfx::Canvas* canvas) override;
- //TODO:[NextBrowser][Merging]
- //commented the code temporarily to fix the build error
- //gfx::Size CalculatePreferredSize() const override;
+ gfx::Size CalculatePreferredSize(const views::SizeBounds& available_size) const override;
// views::MaskedTargeterDelegate:
bool GetHitTestMask(SkPath* mask) const override;
base::WeakPtrFactory<HandOffButton> weak_factory_{this};
};
-#endif // CHROME_BROWSER_UI_VIEWS_TABS_NEW_TAB_BUTTON_H_
+#endif // CHROME_BROWSER_UI_VIEWS_TABS_HANDOFF_BUTTON_H_
multi_language_controller->GetUTF16String("COM_SID_OK");
SetButtonLabel(ui::mojom::DialogButton::kCancel, close);
- //TODO:[NextBrowser][Merging]
- //commented the code temporarily to fix the build error
- // SetDefaultButton(ui::mojom::DialogButton::kCancel);
- //DialogDelegate::SetButtons(ui::mojom::DialogButton::kCancel);
+ SetDefaultButton(static_cast<int>(ui::mojom::DialogButton::kCancel));
+ DialogDelegate::SetButtons(static_cast<int>(ui::mojom::DialogButton::kCancel));
SetCancelCallback(
base::BindOnce(&SamsungHandOffTimeoutBubbleDialogView::ClearHandoffPopup,
SetCancelCallback(
base::BindOnce(&SamsungPasskeyBubbleDialogView::CancelAuthentication,
base::Unretained(this)));
- //TODO:[NextBrowser][Merging]
- //commented the code temporarily to fix the build error
- //DialogDelegate::SetButtons(ui::mojom::DialogButton::kCancel);
+ DialogDelegate::SetButtons(static_cast<int>(ui::mojom::DialogButton::kCancel));
const views::LayoutProvider* provider = views::LayoutProvider::Get();
set_margins(provider->GetDialogInsetsForContentType(
return;
}
-// //TODO:[NextBrowser][Merging]
- //commented the code temporarily to fix the build error
- // efl_helper->CancelAuthentication();
- //error: no member named 'CancelAuthentication' in 'content::RWHVAuraCommonHelperEfl'
+ efl_helper->CancelAuthentication();
auto passkey_controller =
samsung_browser_main::SamsungBrowserCore::instance()->PasskeyController();
#include "ui/views/controls/highlight_path_generator.h"
#include "ui/views/view_class_properties.h"
#include "ui/views/widget/widget.h"
+#include <optional>
#if BUILDFLAG(IS_WIN)
#include "ui/display/win/screen_win.h"
public_deps = [ "//base" ]
configs += [
-
+ "//tizen_src/build:capi-media-vision-barcode",
+ "//tizen_src/build:libcapi-media-vision-barcode",
]
}
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-//#include <mv_barcode.h>
+#include <mv_barcode.h>
#include "components/samsung/passkey/passkey_service_impl.h"
bool PasskeyServiceImpl::GenerateImage(std::string contents) {
LOG(INFO) << "PasskeyServiceImpl::GenerateImage() started";
- //TODO:[NextBrowser][Merging]
- //commented the code temporarily to fix the build error
- /*const char* path = "/tmp/webauthn-qrcode.png";
+ const char* path = "/tmp/webauthn-qrcode.png";
const char* qr_contents = contents.c_str();
int ret;
int width = 300;
LOG(INFO) << "mv_barcode_generate_image failed with code %d", ret;
return false;
}
-*/
+
LOG(INFO) << "PasskeyServiceImpl::GenerateImage() completed";
return true;
}