Skip to content

Commit

Permalink
Reader Mode: remove UI button
Browse files Browse the repository at this point in the history
The feature is not ready yet and whilst a flag exists, we default it to on (unlike Chromium) since we use the backend of the feature as a component for the Brave Ads feature
  • Loading branch information
petemill committed Sep 10, 2019
1 parent cb27ba0 commit c7166c1
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
2 changes: 2 additions & 0 deletions browser/ui/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ source_set("ui") {
"views/frame/brave_browser_view.h",
"views/importer/brave_import_lock_dialog_view.cc",
"views/importer/brave_import_lock_dialog_view.h",
"views/reader_mode/brave_reader_mode_icon_view.cc",
"views/reader_mode/brave_reader_mode_icon_view.h",
"views/rounded_separator.cc",
"views/rounded_separator.h",
"views/toolbar/bookmark_button.cc",
Expand Down
11 changes: 11 additions & 0 deletions browser/ui/views/reader_mode/brave_reader_mode_icon_view.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright (c) 2019 The Brave Authors. All rights reserved.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// you can obtain one at http://mozilla.org/MPL/2.0/.

#include "brave/browser/ui/views/reader_mode/brave_reader_mode_icon_view.h"

bool BraveReaderModeIconView::Update() {
SetVisible(false);
return false;
}
21 changes: 21 additions & 0 deletions browser/ui/views/reader_mode/brave_reader_mode_icon_view.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright (c) 2019 The Brave Authors. All rights reserved.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// you can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef BRAVE_BROWSER_UI_VIEWS_READER_MODE_BRAVE_READER_MODE_ICON_VIEW_H_
#define BRAVE_BROWSER_UI_VIEWS_READER_MODE_BRAVE_READER_MODE_ICON_VIEW_H_

#include "chrome/browser/ui/views/reader_mode/reader_mode_icon_view.h"


class BraveReaderModeIconView : public ReaderModeIconView {
public:
using ReaderModeIconView::ReaderModeIconView;
protected:
bool Update() override;

DISALLOW_COPY_AND_ASSIGN(BraveReaderModeIconView);
};

#endif // BRAVE_BROWSER_UI_VIEWS_READER_MODE_BRAVE_READER_MODE_ICON_VIEW_H_
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "brave/browser/ui/views/translate/brave_translate_icon_view.h"
#include "brave/browser/ui/views/reader_mode/brave_reader_mode_icon_view.h"

#include "brave/browser/translate/buildflags/buildflags.h"

#if BUILDFLAG(ENABLE_BRAVE_TRANSLATE_EXTENSION)
#define TranslateIconView BraveTranslateIconView
#endif
#define ReaderModeIconView BraveReaderModeIconView
#include "../../../../../../../chrome/browser/ui/views/page_action/omnibox_page_action_icon_container_view.cc"
#if BUILDFLAG(ENABLE_BRAVE_TRANSLATE_EXTENSION)
#undef TranslateIconView
#endif
#undef ReaderModeIconView

0 comments on commit c7166c1

Please sign in to comment.