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

Side by Side Diff: chrome/browser/protector/settings_change_global_error.h

Issue 10690151: Move implementation of BrowserList onto an inner, instantiatable class, BrowserListImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_PROTECTOR_SETTINGS_CHANGE_GLOBAL_ERROR_H_ 5 #ifndef CHROME_BROWSER_PROTECTOR_SETTINGS_CHANGE_GLOBAL_ERROR_H_
6 #define CHROME_BROWSER_PROTECTOR_SETTINGS_CHANGE_GLOBAL_ERROR_H_ 6 #define CHROME_BROWSER_PROTECTOR_SETTINGS_CHANGE_GLOBAL_ERROR_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "chrome/app/chrome_command_ids.h" 12 #include "chrome/app/chrome_command_ids.h"
13 #include "chrome/browser/protector/base_setting_change.h" 13 #include "chrome/browser/protector/base_setting_change.h"
14 #include "chrome/browser/ui/browser_list.h" 14 #include "chrome/browser/ui/browser_list_observer.h"
15 #include "chrome/browser/ui/global_error/global_error.h" 15 #include "chrome/browser/ui/global_error/global_error.h"
16 16
17 class Browser; 17 class Browser;
18 class Profile; 18 class Profile;
19 19
20 namespace protector { 20 namespace protector {
21 21
22 class BaseSettingChange; 22 class BaseSettingChange;
23 class SettingsChangeGlobalErrorDelegate; 23 class SettingsChangeGlobalErrorDelegate;
24 24
25 // Global error about unwanted settings changes. 25 // Global error about unwanted settings changes.
26 class SettingsChangeGlobalError : public GlobalError, 26 class SettingsChangeGlobalError : public GlobalError,
27 public BrowserList::Observer { 27 public chrome::BrowserListObserver {
28 public: 28 public:
29 // Creates new global error about setting changes |change| which must not be 29 // Creates new global error about setting changes |change| which must not be
30 // deleted until |delegate->OnRemovedFromProfile| is called. Uses |delegate| 30 // deleted until |delegate->OnRemovedFromProfile| is called. Uses |delegate|
31 // to notify about user decision. 31 // to notify about user decision.
32 SettingsChangeGlobalError(BaseSettingChange* change, 32 SettingsChangeGlobalError(BaseSettingChange* change,
33 SettingsChangeGlobalErrorDelegate* delegate); 33 SettingsChangeGlobalErrorDelegate* delegate);
34 virtual ~SettingsChangeGlobalError(); 34 virtual ~SettingsChangeGlobalError();
35 35
36 // Adds a global error to the given browser profile and shows a bubble 36 // Adds a global error to the given browser profile and shows a bubble
37 // immediately if |show_bubble| is |true|. 37 // immediately if |show_bubble| is |true|.
(...skipping 20 matching lines...) Expand all
58 virtual bool HasBubbleView() OVERRIDE; 58 virtual bool HasBubbleView() OVERRIDE;
59 virtual int GetBubbleViewIconResourceID() OVERRIDE; 59 virtual int GetBubbleViewIconResourceID() OVERRIDE;
60 virtual string16 GetBubbleViewTitle() OVERRIDE; 60 virtual string16 GetBubbleViewTitle() OVERRIDE;
61 virtual string16 GetBubbleViewMessage() OVERRIDE; 61 virtual string16 GetBubbleViewMessage() OVERRIDE;
62 virtual string16 GetBubbleViewAcceptButtonLabel() OVERRIDE; 62 virtual string16 GetBubbleViewAcceptButtonLabel() OVERRIDE;
63 virtual string16 GetBubbleViewCancelButtonLabel() OVERRIDE; 63 virtual string16 GetBubbleViewCancelButtonLabel() OVERRIDE;
64 virtual void OnBubbleViewDidClose(Browser* browser) OVERRIDE; 64 virtual void OnBubbleViewDidClose(Browser* browser) OVERRIDE;
65 virtual void BubbleViewAcceptButtonPressed(Browser* browser) OVERRIDE; 65 virtual void BubbleViewAcceptButtonPressed(Browser* browser) OVERRIDE;
66 virtual void BubbleViewCancelButtonPressed(Browser* browser) OVERRIDE; 66 virtual void BubbleViewCancelButtonPressed(Browser* browser) OVERRIDE;
67 67
68 // BrowserList::Observer implementation. 68 // chrome::BrowserListObserver implementation.
69 virtual void OnBrowserAdded(Browser* browser) OVERRIDE {} 69 virtual void OnBrowserAdded(Browser* browser) OVERRIDE {}
70 virtual void OnBrowserRemoved(Browser* browser) OVERRIDE {} 70 virtual void OnBrowserRemoved(Browser* browser) OVERRIDE {}
71 virtual void OnBrowserSetLastActive(Browser* browser) OVERRIDE; 71 virtual void OnBrowserSetLastActive(Browser* browser) OVERRIDE;
72 72
73 // Displays the bubble in |browser|'s window. 73 // Displays the bubble in |browser|'s window.
74 void ShowBubbleInBrowser(Browser* browser); 74 void ShowBubbleInBrowser(Browser* browser);
75 75
76 // Called when the wrench menu item has been displayed for enough time 76 // Called when the wrench menu item has been displayed for enough time
77 // without user interaction. 77 // without user interaction.
78 void OnInactiveTimeout(); 78 void OnInactiveTimeout();
(...skipping 17 matching lines...) Expand all
96 96
97 // Menu command ID assigned to |this| from the pool of available IDs. 97 // Menu command ID assigned to |this| from the pool of available IDs.
98 int menu_id_; 98 int menu_id_;
99 99
100 DISALLOW_COPY_AND_ASSIGN(SettingsChangeGlobalError); 100 DISALLOW_COPY_AND_ASSIGN(SettingsChangeGlobalError);
101 }; 101 };
102 102
103 } // namespace protector 103 } // namespace protector
104 104
105 #endif // CHROME_BROWSER_PROTECTOR_SETTINGS_CHANGE_GLOBAL_ERROR_H_ 105 #endif // CHROME_BROWSER_PROTECTOR_SETTINGS_CHANGE_GLOBAL_ERROR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698