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

Side by Side Diff: chrome/browser/views/about_network_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, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/views/about_network_dialog.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_VIEWS_ABOUT_NETWORK_DIALOG_H_ 5 #ifndef CHROME_BROWSER_VIEWS_ABOUT_NETWORK_DIALOG_H_
6 #define CHROME_BROWSER_VIEWS_ABOUT_NETWORK_DIALOG_H_ 6 #define CHROME_BROWSER_VIEWS_ABOUT_NETWORK_DIALOG_H_
7 7
8 #include "base/singleton.h" 8 #include "base/singleton.h"
9 #include "chrome/browser/views/logging_about_dialog.h"
9 #include "chrome/views/base_button.h" 10 #include "chrome/views/base_button.h"
10 #include "chrome/views/dialog_delegate.h" 11 #include "chrome/views/dialog_delegate.h"
11 12
12 namespace views { 13 namespace views {
13 class TextButton; 14 class TextButton;
14 class TextField; 15 class TextField;
15 } // namespace views 16 } // namespace views
16 17
17 class AboutNetworkDialog : public views::DialogDelegate, 18 class AboutNetworkDialog : public LoggingAboutDialog,
18 public views::BaseButton::ButtonListener, 19 public views::BaseButton::ButtonListener {
19 public views::View {
20 public: 20 public:
21 // This dialog is a singleton. If the dialog is already opened, it won't do 21 // This dialog is a singleton. If the dialog is already opened, it won't do
22 // anything, so you can just blindly call this function all you want. 22 // anything, so you can just blindly call this function all you want.
23 static void RunDialog(); 23 static void RunDialog();
24 24
25 virtual ~AboutNetworkDialog(); 25 virtual ~AboutNetworkDialog();
26 26
27 // Appends the given string to the dialog box. This is called by the job
28 // tracker (see the .cc file) when "stuff happens."
29 void AppendText(const std::wstring& text);
30
31 // Returns true if we're currently tracking network operations. 27 // Returns true if we're currently tracking network operations.
32 bool tracking() const { return tracking_; } 28 bool tracking() const { return tracking_; }
33 29
34 private: 30 private:
35 friend struct DefaultSingletonTraits<AboutNetworkDialog>; 31 friend struct DefaultSingletonTraits<AboutNetworkDialog>;
36 32
37 AboutNetworkDialog(); 33 AboutNetworkDialog();
38 34
39 // Sets up all UI controls for the dialog. 35 // views::BaseButton::ButtonListener implementation.
40 void SetupControls(); 36 virtual void ButtonPressed(views::BaseButton* button);
41 37
42 virtual gfx::Size GetPreferredSize(); 38 // LoggingAboutDialog implementation.
43 virtual views::View* GetContentsView(); 39 virtual void SetupButtonColumnSet(views::ColumnSet* set);
44 virtual int GetDialogButtons() const; 40 virtual void AddButtonControlsToLayout(views::GridLayout* layout);
45 virtual std::wstring GetWindowTitle() const;
46 virtual void Layout();
47
48 // views::WindowDelegate (via view::DialogDelegate).
49 virtual bool CanResize() const;
50
51 // views::BaseButton::ButtonListener.
52 virtual void ButtonPressed(views::BaseButton* button);
53 41
54 views::TextButton* track_toggle_; 42 views::TextButton* track_toggle_;
55 views::TextButton* show_button_; 43 views::TextButton* show_button_;
56 views::TextButton* clear_button_; 44 views::TextButton* clear_button_;
57 views::TextField* text_field_;
58 45
59 // Set to true when we're tracking network status. 46 // Set to true when we're tracking network status.
60 bool tracking_; 47 bool tracking_;
61 48
62 DISALLOW_COPY_AND_ASSIGN(AboutNetworkDialog); 49 DISALLOW_COPY_AND_ASSIGN(AboutNetworkDialog);
63 }; 50 };
64 51
65 #endif // CHROME_BROWSER_VIEWS_ABOUT_NETWORK_DIALOG_H_ 52 #endif // CHROME_BROWSER_VIEWS_ABOUT_NETWORK_DIALOG_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/views/about_network_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698