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

Side by Side Diff: chrome/browser/ui/views/importer_view.h

Issue 5873005: Views: Implement the ImporterList::Observer in ImporterView to enable the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Line length fix. Created 10 years 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 | « chrome/browser/importer/importer_list.cc ('k') | chrome/browser/ui/views/importer_view.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_UI_VIEWS_IMPORTER_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_IMPORTER_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_IMPORTER_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_IMPORTER_VIEW_H_
7 #pragma once 7 #pragma once
8 8
9 #include "app/combobox_model.h" 9 #include "app/combobox_model.h"
10 #include "base/string16.h" 10 #include "base/string16.h"
(...skipping 13 matching lines...) Expand all
24 24
25 // ImporterView draws the dialog that allows the user to select what to 25 // ImporterView draws the dialog that allows the user to select what to
26 // import from other browsers. 26 // import from other browsers.
27 // Note: The UI team hasn't defined yet how the import UI will look like. 27 // Note: The UI team hasn't defined yet how the import UI will look like.
28 // So now use dialog as a placeholder. 28 // So now use dialog as a placeholder.
29 class ImporterView : public views::View, 29 class ImporterView : public views::View,
30 public views::DialogDelegate, 30 public views::DialogDelegate,
31 public views::ButtonListener, 31 public views::ButtonListener,
32 public ComboboxModel, 32 public ComboboxModel,
33 public views::Combobox::Listener, 33 public views::Combobox::Listener,
34 public ImporterList::Observer,
34 public ImportObserver { 35 public ImportObserver {
35 public: 36 public:
36 // Creates a new ImporterView. |initial_state| is a bitmask of ImportItems. 37 // Creates a new ImporterView. |initial_state| is a bitmask of ImportItems.
37 // Each checkbox for the bits in |initial_state| is checked. 38 // Each checkbox for the bits in |initial_state| is checked.
38 ImporterView(Profile* profile, int initial_state); 39 ImporterView(Profile* profile, int initial_state);
39 virtual ~ImporterView(); 40 virtual ~ImporterView();
40 41
41 // Overridden from views::View: 42 // views::View implementation.
42 virtual gfx::Size GetPreferredSize(); 43 virtual gfx::Size GetPreferredSize();
43 virtual void Layout(); 44 virtual void Layout();
44 45
45 // Overridden from views::DialogDelegate: 46 // views::DialogDelegate implementation.
46 virtual std::wstring GetDialogButtonLabel( 47 virtual std::wstring GetDialogButtonLabel(
47 MessageBoxFlags::DialogButton button) const; 48 MessageBoxFlags::DialogButton button) const;
48 virtual bool IsDialogButtonEnabled( 49 virtual bool IsDialogButtonEnabled(
49 MessageBoxFlags::DialogButton button) const; 50 MessageBoxFlags::DialogButton button) const;
50 virtual bool IsModal() const; 51 virtual bool IsModal() const;
51 virtual std::wstring GetWindowTitle() const; 52 virtual std::wstring GetWindowTitle() const;
52 virtual bool Accept(); 53 virtual bool Accept();
53 virtual views::View* GetContentsView(); 54 virtual views::View* GetContentsView();
54 55
55 // Overridden from views::ButtonListener: 56 // views::ButtonListener implementation.
56 virtual void ButtonPressed(views::Button* sender, const views::Event& event); 57 virtual void ButtonPressed(views::Button* sender, const views::Event& event);
57 58
58 // Overridden from ComboboxModel: 59 // ComboboxModel implementation.
59 virtual int GetItemCount(); 60 virtual int GetItemCount();
60 virtual string16 GetItemAt(int index); 61 virtual string16 GetItemAt(int index);
61 62
62 // Overridden from ChromeViews::Combobox::Listener: 63 // ChromeViews::Combobox::Listener implementation.
63 virtual void ItemChanged(views::Combobox* combobox, 64 virtual void ItemChanged(views::Combobox* combobox,
64 int prev_index, 65 int prev_index,
65 int new_index); 66 int new_index);
66 67
67 // Overridden from ImportObserver: 68 // ImporterList::Observer implementation.
69 virtual void SourceProfilesLoaded();
70
71 // ImportObserver implementation.
68 virtual void ImportCanceled(); 72 virtual void ImportCanceled();
69 virtual void ImportComplete(); 73 virtual void ImportComplete();
70 74
71 private: 75 private:
72 // Initializes the controls on the dialog. 76 // Initializes the controls on the dialog.
73 void SetupControl(); 77 void SetupControl();
74 78
75 // Creates and initializes a new check-box. 79 // Creates and initializes a new check-box.
76 views::Checkbox* InitCheckbox(const std::wstring& text, bool checked); 80 views::Checkbox* InitCheckbox(const std::wstring& text, bool checked);
77 81
(...skipping 22 matching lines...) Expand all
100 104
101 // Initial state of the |checkbox_items_|. 105 // Initial state of the |checkbox_items_|.
102 uint16 initial_state_; 106 uint16 initial_state_;
103 107
104 Profile* profile_; 108 Profile* profile_;
105 109
106 DISALLOW_COPY_AND_ASSIGN(ImporterView); 110 DISALLOW_COPY_AND_ASSIGN(ImporterView);
107 }; 111 };
108 112
109 #endif // CHROME_BROWSER_UI_VIEWS_IMPORTER_VIEW_H_ 113 #endif // CHROME_BROWSER_UI_VIEWS_IMPORTER_VIEW_H_
OLDNEW
« no previous file with comments | « chrome/browser/importer/importer_list.cc ('k') | chrome/browser/ui/views/importer_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698