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

Side by Side Diff: chrome/browser/dom_ui/ntp_login_handler.cc

Issue 6541006: WebUI: Move more files from chrome/browser/dom_ui to chrome/browser/webui. Part 3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
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 #include "chrome/browser/dom_ui/ntp_login_handler.h" 5 #include "chrome/browser/dom_ui/ntp_login_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/dom_ui/web_ui_util.h"
11 #include "chrome/browser/prefs/pref_notifier.h" 10 #include "chrome/browser/prefs/pref_notifier.h"
12 #include "chrome/browser/prefs/pref_service.h" 11 #include "chrome/browser/prefs/pref_service.h"
13 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/sync/profile_sync_service.h" 13 #include "chrome/browser/sync/profile_sync_service.h"
15 #include "chrome/browser/sync/sync_setup_flow.h" 14 #include "chrome/browser/sync/sync_setup_flow.h"
15 #include "chrome/browser/webui/web_ui_util.h"
16 #include "chrome/common/notification_details.h"
16 #include "chrome/common/pref_names.h" 17 #include "chrome/common/pref_names.h"
17 #include "chrome/common/notification_details.h"
18 18
19 NTPLoginHandler::NTPLoginHandler() { 19 NTPLoginHandler::NTPLoginHandler() {
20 } 20 }
21 21
22 NTPLoginHandler::~NTPLoginHandler() { 22 NTPLoginHandler::~NTPLoginHandler() {
23 } 23 }
24 24
25 WebUIMessageHandler* NTPLoginHandler::Attach(WebUI* web_ui) { 25 WebUIMessageHandler* NTPLoginHandler::Attach(WebUI* web_ui) {
26 PrefService* pref_service = web_ui->GetProfile()->GetPrefs(); 26 PrefService* pref_service = web_ui->GetProfile()->GetPrefs();
27 username_pref_.Init(prefs::kGoogleServicesUsername, pref_service, this); 27 username_pref_.Init(prefs::kGoogleServicesUsername, pref_service, this);
(...skipping 18 matching lines...) Expand all
46 void NTPLoginHandler::HandleInitializeLogin(const ListValue* args) { 46 void NTPLoginHandler::HandleInitializeLogin(const ListValue* args) {
47 UpdateLogin(); 47 UpdateLogin();
48 } 48 }
49 49
50 void NTPLoginHandler::UpdateLogin() { 50 void NTPLoginHandler::UpdateLogin() {
51 std::string username = web_ui_->GetProfile()->GetPrefs()->GetString( 51 std::string username = web_ui_->GetProfile()->GetPrefs()->GetString(
52 prefs::kGoogleServicesUsername); 52 prefs::kGoogleServicesUsername);
53 StringValue string_value(username); 53 StringValue string_value(username);
54 web_ui_->CallJavascriptFunction(L"updateLogin", string_value); 54 web_ui_->CallJavascriptFunction(L"updateLogin", string_value);
55 } 55 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/ntp_login_handler.h ('k') | chrome/browser/dom_ui/options/autofill_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698