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

Side by Side Diff: chrome/browser/ui/webui/signin_internals_ui.cc

Issue 11881055: Simplify WebUI data sources. Currently WebUI data sources implement a URLDataSourceDelegate interfa… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix issue in about_ui exposed by cros tests Created 7 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) 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 #include "chrome/browser/ui/webui/signin_internals_ui.h" 5 #include "chrome/browser/ui/webui/signin_internals_ui.h"
6 6
7 #include "base/hash.h" 7 #include "base/hash.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/signin/about_signin_internals.h" 9 #include "chrome/browser/signin/about_signin_internals.h"
10 #include "chrome/browser/signin/about_signin_internals_factory.h" 10 #include "chrome/browser/signin/about_signin_internals_factory.h"
(...skipping 16 matching lines...) Expand all
27 IDR_SIGNIN_INTERNALS_INDEX_JS); 27 IDR_SIGNIN_INTERNALS_INDEX_JS);
28 source->set_default_resource(IDR_SIGNIN_INTERNALS_INDEX_HTML); 28 source->set_default_resource(IDR_SIGNIN_INTERNALS_INDEX_HTML);
29 return source; 29 return source;
30 } 30 }
31 31
32 } // namespace 32 } // namespace
33 33
34 SignInInternalsUI::SignInInternalsUI(content::WebUI* web_ui) 34 SignInInternalsUI::SignInInternalsUI(content::WebUI* web_ui)
35 : WebUIController(web_ui) { 35 : WebUIController(web_ui) {
36 Profile* profile = Profile::FromWebUI(web_ui); 36 Profile* profile = Profile::FromWebUI(web_ui);
37 ChromeURLDataManager::AddDataSource(profile, 37 ChromeURLDataManager::AddDataSourceImpl(
38 CreateSignInInternalsHTMLSource()); 38 profile, CreateSignInInternalsHTMLSource());
39 if (profile) { 39 if (profile) {
40 AboutSigninInternals* about_signin_internals = 40 AboutSigninInternals* about_signin_internals =
41 AboutSigninInternalsFactory::GetForProfile(profile); 41 AboutSigninInternalsFactory::GetForProfile(profile);
42 if (about_signin_internals) 42 if (about_signin_internals)
43 about_signin_internals->AddSigninObserver(this); 43 about_signin_internals->AddSigninObserver(this);
44 } 44 }
45 } 45 }
46 46
47 SignInInternalsUI::~SignInInternalsUI() { 47 SignInInternalsUI::~SignInInternalsUI() {
48 Profile* profile = Profile::FromWebUI(web_ui()); 48 Profile* profile = Profile::FromWebUI(web_ui());
(...skipping 29 matching lines...) Expand all
78 return true; 78 return true;
79 } 79 }
80 } 80 }
81 return false; 81 return false;
82 } 82 }
83 83
84 void SignInInternalsUI::OnSigninStateChanged(scoped_ptr<DictionaryValue> info) { 84 void SignInInternalsUI::OnSigninStateChanged(scoped_ptr<DictionaryValue> info) {
85 const std::string& event_handler = "chrome.signin.onSigninInfoChanged.fire"; 85 const std::string& event_handler = "chrome.signin.onSigninInfoChanged.fire";
86 web_ui()->CallJavascriptFunction(event_handler, *info); 86 web_ui()->CallJavascriptFunction(event_handler, *info);
87 } 87 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698