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

Unified Diff: chrome/browser/views/logging_about_dialog.h

Issue 19433: Factor out the common parts of the about network dialog. I will be using this... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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 | « chrome/browser/views/browser_views.vcproj ('k') | chrome/browser/views/logging_about_dialog.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/logging_about_dialog.h
===================================================================
--- chrome/browser/views/logging_about_dialog.h (revision 8721)
+++ chrome/browser/views/logging_about_dialog.h (working copy)
@@ -2,64 +2,64 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_VIEWS_ABOUT_NETWORK_DIALOG_H_
-#define CHROME_BROWSER_VIEWS_ABOUT_NETWORK_DIALOG_H_
+#ifndef CHROME_BROWSER_VIEWS_LOGGING_ABOUT_DIALOG_H_
+#define CHROME_BROWSER_VIEWS_LOGGING_ABOUT_DIALOG_H_
#include "base/singleton.h"
#include "chrome/views/base_button.h"
#include "chrome/views/dialog_delegate.h"
namespace views {
+class ColumnSet;
+class GridLayout;
class TextButton;
class TextField;
} // namespace views
-class AboutNetworkDialog : public views::DialogDelegate,
- public views::BaseButton::ButtonListener,
+// This is the base class for dialog boxes used in debugging that dump text
+// into a textbox. The derived class specifies which buttons appear at the top
+// of the dialog, this class manages the text area.
+class LoggingAboutDialog : public views::DialogDelegate,
public views::View {
public:
- // This dialog is a singleton. If the dialog is already opened, it won't do
- // anything, so you can just blindly call this function all you want.
- static void RunDialog();
+ virtual ~LoggingAboutDialog();
- virtual ~AboutNetworkDialog();
-
// Appends the given string to the dialog box. This is called by the job
// tracker (see the .cc file) when "stuff happens."
void AppendText(const std::wstring& text);
- // Returns true if we're currently tracking network operations.
- bool tracking() const { return tracking_; }
+ protected:
+ // The derived class should be sure to call SetupControls. We don't want
+ // this class to do it becuase it calls virtual functions, and the derived
+ // class wouldn't be constructed yet.
+ LoggingAboutDialog();
- private:
- friend struct DefaultSingletonTraits<AboutNetworkDialog>;
-
- AboutNetworkDialog();
-
// Sets up all UI controls for the dialog.
void SetupControls();
+ // Sets up the column set for the buttons that appears at the top of the
+ // dialog.
+ virtual void SetupButtonColumnSet(views::ColumnSet* set) = 0;
+
+ // Adds any custom buttons to the layout. This will be in the column set
+ // set up above.
+ virtual void AddButtonControlsToLayout(views::GridLayout* layout) = 0;
+
+ views::TextField* text_field() { return text_field_; }
+
+ private:
virtual gfx::Size GetPreferredSize();
virtual views::View* GetContentsView();
virtual int GetDialogButtons() const;
virtual std::wstring GetWindowTitle() const;
- virtual void Layout();
// views::WindowDelegate (via view::DialogDelegate).
virtual bool CanResize() const;
- // views::BaseButton::ButtonListener.
- virtual void ButtonPressed(views::BaseButton* button);
-
- views::TextButton* track_toggle_;
- views::TextButton* show_button_;
- views::TextButton* clear_button_;
+ // The text field that contains the log messages.
views::TextField* text_field_;
- // Set to true when we're tracking network status.
- bool tracking_;
-
- DISALLOW_COPY_AND_ASSIGN(AboutNetworkDialog);
+ DISALLOW_COPY_AND_ASSIGN(LoggingAboutDialog);
};
-#endif // CHROME_BROWSER_VIEWS_ABOUT_NETWORK_DIALOG_H_
+#endif // CHROME_BROWSER_VIEWS_LOGGING_ABOUT_DIALOG_H_
Property changes on: chrome\browser\views\logging_about_dialog.h
___________________________________________________________________
Added: svn:mergeinfo
Merged /branches/chrome_webkit_merge_branch/chrome/browser/views/about_network_dialog.h:r69-2775
« no previous file with comments | « chrome/browser/views/browser_views.vcproj ('k') | chrome/browser/views/logging_about_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698