Commit b40d7b47 authored by tfarina@chromium.org's avatar tfarina@chromium.org

views: Remove the implementation of about chrome dialog.

Now that http://crbug.com/115123 is fixed, we can remove the views implementation, and
along the way we can remove the ShowAboutChromeDialog function from BrowseWindow
and the platform-specific overridden functions.

BUG=138724
R=pkasting@chromium.org
TBR=sky@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10800096

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148474 0039d316-1c4b-4281-b951-d872f2087c98
parent e575361d
...@@ -217,9 +217,6 @@ class BrowserWindow : public BaseWindow { ...@@ -217,9 +217,6 @@ class BrowserWindow : public BaseWindow {
// Shows or hides the bookmark bar depending on its current visibility. // Shows or hides the bookmark bar depending on its current visibility.
virtual void ToggleBookmarkBar() = 0; virtual void ToggleBookmarkBar() = 0;
// Shows the About Chrome dialog box.
virtual void ShowAboutChromeDialog() = 0;
// Shows the Update Recommended dialog box. // Shows the Update Recommended dialog box.
virtual void ShowUpdateChromeDialog() = 0; virtual void ShowUpdateChromeDialog() = 0;
......
...@@ -91,7 +91,6 @@ class BrowserWindowCocoa : public BrowserWindow, ...@@ -91,7 +91,6 @@ class BrowserWindowCocoa : public BrowserWindow,
virtual void ConfirmAddSearchProvider(TemplateURL* template_url, virtual void ConfirmAddSearchProvider(TemplateURL* template_url,
Profile* profile) OVERRIDE; Profile* profile) OVERRIDE;
virtual void ToggleBookmarkBar() OVERRIDE; virtual void ToggleBookmarkBar() OVERRIDE;
virtual void ShowAboutChromeDialog() OVERRIDE;
virtual void ShowUpdateChromeDialog() OVERRIDE; virtual void ShowUpdateChromeDialog() OVERRIDE;
virtual void ShowTaskManager() OVERRIDE; virtual void ShowTaskManager() OVERRIDE;
virtual void ShowBackgroundPages() OVERRIDE; virtual void ShowBackgroundPages() OVERRIDE;
......
...@@ -414,11 +414,6 @@ void BrowserWindowCocoa::AddFindBar( ...@@ -414,11 +414,6 @@ void BrowserWindowCocoa::AddFindBar(
[controller_ addFindBar:find_bar_cocoa_controller]; [controller_ addFindBar:find_bar_cocoa_controller];
} }
void BrowserWindowCocoa::ShowAboutChromeDialog() {
// Go through AppController's implementation to bring up the branded panel.
[[NSApp delegate] orderFrontStandardAboutPanel:nil];
}
void BrowserWindowCocoa::ShowUpdateChromeDialog() { void BrowserWindowCocoa::ShowUpdateChromeDialog() {
restart_browser::RequestRestart(window()); restart_browser::RequestRestart(window());
} }
......
...@@ -1054,10 +1054,6 @@ void BrowserWindowGtk::ToggleBookmarkBar() { ...@@ -1054,10 +1054,6 @@ void BrowserWindowGtk::ToggleBookmarkBar() {
bookmark_utils::ToggleWhenVisible(browser_->profile()); bookmark_utils::ToggleWhenVisible(browser_->profile());
} }
void BrowserWindowGtk::ShowAboutChromeDialog() {
// Do nothing here, we show a WebUI page instead of a native one.
}
void BrowserWindowGtk::ShowUpdateChromeDialog() { void BrowserWindowGtk::ShowUpdateChromeDialog() {
UpdateRecommendedDialog::Show(window_); UpdateRecommendedDialog::Show(window_);
} }
......
...@@ -120,7 +120,6 @@ class BrowserWindowGtk : public BrowserWindow, ...@@ -120,7 +120,6 @@ class BrowserWindowGtk : public BrowserWindow,
virtual void ConfirmAddSearchProvider(TemplateURL* template_url, virtual void ConfirmAddSearchProvider(TemplateURL* template_url,
Profile* profile) OVERRIDE; Profile* profile) OVERRIDE;
virtual void ToggleBookmarkBar() OVERRIDE; virtual void ToggleBookmarkBar() OVERRIDE;
virtual void ShowAboutChromeDialog() OVERRIDE;
virtual void ShowUpdateChromeDialog() OVERRIDE; virtual void ShowUpdateChromeDialog() OVERRIDE;
virtual void ShowTaskManager() OVERRIDE; virtual void ShowTaskManager() OVERRIDE;
virtual void ShowBackgroundPages() OVERRIDE; virtual void ShowBackgroundPages() OVERRIDE;
......
...@@ -289,10 +289,6 @@ void PanelBrowserWindow::ToggleBookmarkBar() { ...@@ -289,10 +289,6 @@ void PanelBrowserWindow::ToggleBookmarkBar() {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
} }
void PanelBrowserWindow::ShowAboutChromeDialog() {
NOTIMPLEMENTED();
}
void PanelBrowserWindow::ShowUpdateChromeDialog() { void PanelBrowserWindow::ShowUpdateChromeDialog() {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
} }
......
...@@ -93,7 +93,6 @@ class PanelBrowserWindow : public BrowserWindow, ...@@ -93,7 +93,6 @@ class PanelBrowserWindow : public BrowserWindow,
virtual void ConfirmAddSearchProvider(TemplateURL* template_url, virtual void ConfirmAddSearchProvider(TemplateURL* template_url,
Profile* profile) OVERRIDE; Profile* profile) OVERRIDE;
virtual void ToggleBookmarkBar() OVERRIDE; virtual void ToggleBookmarkBar() OVERRIDE;
virtual void ShowAboutChromeDialog() OVERRIDE;
virtual void ShowUpdateChromeDialog() OVERRIDE; virtual void ShowUpdateChromeDialog() OVERRIDE;
virtual void ShowTaskManager() OVERRIDE; virtual void ShowTaskManager() OVERRIDE;
virtual void ShowBackgroundPages() OVERRIDE; virtual void ShowBackgroundPages() OVERRIDE;
......
This diff is collapsed.
// Copyright (c) 2012 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_UI_VIEWS_ABOUT_CHROME_VIEW_H_
#define CHROME_BROWSER_UI_VIEWS_ABOUT_CHROME_VIEW_H_
#include <string>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/link_listener.h"
#include "ui/views/view.h"
#include "ui/views/window/dialog_delegate.h"
#if defined(OS_WIN) && !defined(USE_AURA)
#include "chrome/browser/google/google_update_win.h"
#endif
namespace views {
class Textfield;
class Throbber;
}
class Browser;
////////////////////////////////////////////////////////////////////////////////
//
// The AboutChromeView class is responsible for drawing the UI controls of the
// About Chrome dialog that allows the user to see what version is installed
// and check for updates.
//
////////////////////////////////////////////////////////////////////////////////
class AboutChromeView : public views::DialogDelegateView,
public views::LinkListener
#if defined(OS_WIN) && !defined(USE_AURA)
, public GoogleUpdateStatusListener
#endif
{
public:
explicit AboutChromeView(Browser* browser);
virtual ~AboutChromeView();
// Initialize the controls on the dialog.
void Init();
// Overridden from views::View:
virtual gfx::Size GetPreferredSize() OVERRIDE;
virtual void Layout() OVERRIDE;
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
virtual void ViewHierarchyChanged(bool is_add,
views::View* parent,
views::View* child) OVERRIDE;
// Overridden from views::DialogDelegate:
virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE;
virtual bool IsDialogButtonEnabled(ui::DialogButton button) const OVERRIDE;
virtual bool IsDialogButtonVisible(ui::DialogButton button) const OVERRIDE;
virtual int GetDefaultDialogButton() const OVERRIDE;
virtual bool CanResize() const OVERRIDE;
virtual bool CanMaximize() const OVERRIDE;
virtual ui::ModalType GetModalType() const OVERRIDE;
virtual string16 GetWindowTitle() const OVERRIDE;
virtual bool Accept() OVERRIDE;
virtual views::View* GetContentsView() OVERRIDE;
// Overridden from views::LinkListener:
virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE;
#if defined(OS_WIN) && !defined(USE_AURA)
// Overridden from GoogleUpdateStatusListener:
virtual void OnReportResults(GoogleUpdateUpgradeResult result,
GoogleUpdateErrorCode error_code,
const string16& error_message,
const string16& version) OVERRIDE;
#endif
private:
#if defined(OS_WIN) && !defined(USE_AURA)
// Update the UI to show the status of the upgrade.
void UpdateStatus(GoogleUpdateUpgradeResult result,
GoogleUpdateErrorCode error_code,
const string16& error_message);
// Update the size of the window containing this view to account for more
// text being displayed (error messages, etc). Returns how many pixels the
// window was increased by (if any).
int EnlargeWindowSizeIfNeeded();
#endif
Browser* browser_;
// UI elements on the dialog.
views::ImageView* about_dlg_background_logo_;
views::Label* about_title_label_;
views::Textfield* version_label_;
views::Label* copyright_label_;
views::Label* main_text_label_;
int main_text_label_height_;
views::Link* chromium_url_;
gfx::Rect chromium_url_rect_;
views::Link* open_source_url_;
gfx::Rect open_source_url_rect_;
views::Link* terms_of_service_url_;
gfx::Rect terms_of_service_url_rect_;
// NULL in non-official builds.
views::Label* error_label_;
// UI elements we add to the parent view.
scoped_ptr<views::Throbber> throbber_;
views::ImageView success_indicator_;
views::ImageView update_available_indicator_;
views::ImageView timeout_indicator_;
views::Label update_label_;
// The dialog dimensions.
gfx::Size dialog_dimensions_;
// Keeps track of the visible state of the Restart Now button.
bool restart_button_visible_;
// The text to display as the main label of the About box. We draw this text
// word for word with the help of the WordIterator, and make room for URLs
// which are drawn using views::Link. See also |url_offsets_|.
string16 main_label_chunk1_;
string16 main_label_chunk2_;
string16 main_label_chunk3_;
string16 main_label_chunk4_;
string16 main_label_chunk5_;
// Determines the order of the two links we draw in the main label.
bool chromium_url_appears_first_;
#if defined(OS_WIN) && !defined(USE_AURA)
// The class that communicates with Google Update to find out if an update is
// available and asks it to start an upgrade.
scoped_refptr<GoogleUpdate> google_updater_;
#endif
// The version Google Update reports is available to us.
string16 new_version_available_;
// Whether text direction is left-to-right or right-to-left.
bool text_direction_is_rtl_;
DISALLOW_COPY_AND_ASSIGN(AboutChromeView);
};
#endif // CHROME_BROWSER_UI_VIEWS_ABOUT_CHROME_VIEW_H_
...@@ -60,9 +60,6 @@ void ShowPageInfoBubble(views::View* anchor_view, ...@@ -60,9 +60,6 @@ void ShowPageInfoBubble(views::View* anchor_view,
bool show_history, bool show_history,
content::PageNavigator* navigator); content::PageNavigator* navigator);
// Shows the about dialog. See AboutChromeView.
void ShowAboutChromeView(gfx::NativeWindow parent, Browser* browser);
// Creates and returns a find bar for the given browser window. See FindBarWin. // Creates and returns a find bar for the given browser window. See FindBarWin.
FindBar* CreateFindBar(BrowserView* browser_view); FindBar* CreateFindBar(BrowserView* browser_view);
......
...@@ -1111,10 +1111,6 @@ void BrowserView::ToggleBookmarkBar() { ...@@ -1111,10 +1111,6 @@ void BrowserView::ToggleBookmarkBar() {
bookmark_utils::ToggleWhenVisible(browser_->profile()); bookmark_utils::ToggleWhenVisible(browser_->profile());
} }
void BrowserView::ShowAboutChromeDialog() {
chrome::ShowAboutChromeView(GetWidget()->GetNativeWindow(), browser_.get());
}
void BrowserView::ShowUpdateChromeDialog() { void BrowserView::ShowUpdateChromeDialog() {
UpdateRecommendedMessageBox::Show(GetWidget()->GetNativeWindow()); UpdateRecommendedMessageBox::Show(GetWidget()->GetNativeWindow());
} }
......
...@@ -293,7 +293,6 @@ class BrowserView : public BrowserWindow, ...@@ -293,7 +293,6 @@ class BrowserView : public BrowserWindow,
virtual void ConfirmAddSearchProvider(TemplateURL* template_url, virtual void ConfirmAddSearchProvider(TemplateURL* template_url,
Profile* profile) OVERRIDE; Profile* profile) OVERRIDE;
virtual void ToggleBookmarkBar() OVERRIDE; virtual void ToggleBookmarkBar() OVERRIDE;
virtual void ShowAboutChromeDialog() OVERRIDE;
virtual void ShowUpdateChromeDialog() OVERRIDE; virtual void ShowUpdateChromeDialog() OVERRIDE;
virtual void ShowTaskManager() OVERRIDE; virtual void ShowTaskManager() OVERRIDE;
virtual void ShowBackgroundPages() OVERRIDE; virtual void ShowBackgroundPages() OVERRIDE;
......
...@@ -3471,8 +3471,6 @@ ...@@ -3471,8 +3471,6 @@
'browser/ui/unload_controller.h', 'browser/ui/unload_controller.h',
'browser/ui/user_data_dir_dialog.h', 'browser/ui/user_data_dir_dialog.h',
'browser/ui/view_ids.h', 'browser/ui/view_ids.h',
'browser/ui/views/about_chrome_view.cc',
'browser/ui/views/about_chrome_view.h',
'browser/ui/views/about_ipc_dialog.cc', 'browser/ui/views/about_ipc_dialog.cc',
'browser/ui/views/about_ipc_dialog.h', 'browser/ui/views/about_ipc_dialog.h',
'browser/ui/views/accelerator_table.cc', 'browser/ui/views/accelerator_table.cc',
......
...@@ -98,10 +98,6 @@ bool TestBrowserWindow::IsPanel() const { ...@@ -98,10 +98,6 @@ bool TestBrowserWindow::IsPanel() const {
return false; return false;
} }
void TestBrowserWindow::ShowAboutChromeDialog() {
return;
}
bool TestBrowserWindow::IsDownloadShelfVisible() const { bool TestBrowserWindow::IsDownloadShelfVisible() const {
return false; return false;
} }
......
...@@ -94,7 +94,6 @@ class TestBrowserWindow : public BrowserWindow { ...@@ -94,7 +94,6 @@ class TestBrowserWindow : public BrowserWindow {
virtual void ConfirmAddSearchProvider(TemplateURL* template_url, virtual void ConfirmAddSearchProvider(TemplateURL* template_url,
Profile* profile) OVERRIDE {} Profile* profile) OVERRIDE {}
virtual void ToggleBookmarkBar() OVERRIDE {} virtual void ToggleBookmarkBar() OVERRIDE {}
virtual void ShowAboutChromeDialog() OVERRIDE;
virtual void ShowUpdateChromeDialog() OVERRIDE {} virtual void ShowUpdateChromeDialog() OVERRIDE {}
virtual void ShowTaskManager() OVERRIDE {} virtual void ShowTaskManager() OVERRIDE {}
virtual void ShowBackgroundPages() OVERRIDE {} virtual void ShowBackgroundPages() OVERRIDE {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment