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

Side by Side Diff: chrome/browser/ui/webui/sync_internals_ui.h

Issue 9224002: Make WebUI objects not derive from WebUI. WebUI objects own the controller. This is the ownership... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync to head to clear linux_chromeos browsertest failures Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_WEBUI_SYNC_INTERNALS_UI_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_SYNC_INTERNALS_UI_H_
6 #define CHROME_BROWSER_UI_WEBUI_SYNC_INTERNALS_UI_H_ 6 #define CHROME_BROWSER_UI_WEBUI_SYNC_INTERNALS_UI_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "chrome/browser/sync/js/js_event_handler.h" 14 #include "chrome/browser/sync/js/js_event_handler.h"
15 #include "chrome/browser/sync/js/js_reply_handler.h" 15 #include "chrome/browser/sync/js/js_reply_handler.h"
16 #include "content/browser/webui/web_ui.h"
17 #include "content/public/browser/web_ui_controller.h" 16 #include "content/public/browser/web_ui_controller.h"
18 17
19 namespace browser_sync { 18 namespace browser_sync {
20 class JsController; 19 class JsController;
21 } // namespace browser_sync 20 } // namespace browser_sync
22 21
23 // The implementation for the chrome://sync-internals page. 22 // The implementation for the chrome://sync-internals page.
24 class SyncInternalsUI : public WebUI, public content::WebUIController, 23 class SyncInternalsUI : public content::WebUIController,
25 public browser_sync::JsEventHandler, 24 public browser_sync::JsEventHandler,
26 public browser_sync::JsReplyHandler { 25 public browser_sync::JsReplyHandler {
27 public: 26 public:
28 explicit SyncInternalsUI(content::WebContents* contents); 27 explicit SyncInternalsUI(WebUI* web_ui);
29 virtual ~SyncInternalsUI(); 28 virtual ~SyncInternalsUI();
30 29
31 // WebUIController implementation. 30 // WebUIController implementation.
32 // 31 //
33 // The following messages are processed: 32 // The following messages are processed:
34 // 33 //
35 // getAboutInfo(): 34 // getAboutInfo():
36 // Immediately fires a onGetAboutInfoFinished() event with a 35 // Immediately fires a onGetAboutInfoFinished() event with a
37 // dictionary of sync-related stats and info. 36 // dictionary of sync-related stats and info.
38 // 37 //
(...skipping 17 matching lines...) Expand all
56 const browser_sync::JsArgList& args) OVERRIDE; 55 const browser_sync::JsArgList& args) OVERRIDE;
57 56
58 private: 57 private:
59 base::WeakPtrFactory<SyncInternalsUI> weak_ptr_factory_; 58 base::WeakPtrFactory<SyncInternalsUI> weak_ptr_factory_;
60 base::WeakPtr<browser_sync::JsController> js_controller_; 59 base::WeakPtr<browser_sync::JsController> js_controller_;
61 60
62 DISALLOW_COPY_AND_ASSIGN(SyncInternalsUI); 61 DISALLOW_COPY_AND_ASSIGN(SyncInternalsUI);
63 }; 62 };
64 63
65 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_INTERNALS_UI_H_ 64 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_INTERNALS_UI_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698