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

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc

Issue 8342048: Make NotificationService an interface in the content namespace, and switch callers to use it. Mov... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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/ui/webui/chromeos/login/signin_screen_handler.h" 5 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/hash_tables.h" 10 #include "base/hash_tables.h"
(...skipping 12 matching lines...) Expand all
23 #include "chrome/browser/chromeos/user_cros_settings_provider.h" 23 #include "chrome/browser/chromeos/user_cros_settings_provider.h"
24 #include "chrome/browser/io_thread.h" 24 #include "chrome/browser/io_thread.h"
25 #include "chrome/browser/profiles/profile.h" 25 #include "chrome/browser/profiles/profile.h"
26 #include "chrome/common/chrome_notification_types.h" 26 #include "chrome/common/chrome_notification_types.h"
27 #include "chrome/common/chrome_switches.h" 27 #include "chrome/common/chrome_switches.h"
28 #include "chrome/common/net/gaia/gaia_urls.h" 28 #include "chrome/common/net/gaia/gaia_urls.h"
29 #include "chrome/common/url_constants.h" 29 #include "chrome/common/url_constants.h"
30 #include "content/browser/tab_contents/tab_contents.h" 30 #include "content/browser/tab_contents/tab_contents.h"
31 #include "content/public/browser/notification_observer.h" 31 #include "content/public/browser/notification_observer.h"
32 #include "content/public/browser/notification_registrar.h" 32 #include "content/public/browser/notification_registrar.h"
33 #include "content/common/notification_service.h" 33 #include "content/public/browser/notification_service.h"
34 #include "grit/generated_resources.h" 34 #include "grit/generated_resources.h"
35 #include "net/base/dnsrr_resolver.h" 35 #include "net/base/dnsrr_resolver.h"
36 #include "ui/base/l10n/l10n_util.h" 36 #include "ui/base/l10n/l10n_util.h"
37 37
38 namespace { 38 namespace {
39 39
40 const char kDefaultDomain[] = "@gmail.com"; 40 const char kDefaultDomain[] = "@gmail.com";
41 41
42 // Account picker screen id. 42 // Account picker screen id.
43 const char kAccountPickerScreen[] = "account-picker"; 43 const char kAccountPickerScreen[] = "account-picker";
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 }; 129 };
130 130
131 // NetworkStateInformer implementation ----------------------------------------- 131 // NetworkStateInformer implementation -----------------------------------------
132 132
133 NetworkStateInformer::NetworkStateInformer(WebUI* web_ui) : web_ui_(web_ui) { 133 NetworkStateInformer::NetworkStateInformer(WebUI* web_ui) : web_ui_(web_ui) {
134 NetworkLibrary* cros = CrosLibrary::Get()->GetNetworkLibrary(); 134 NetworkLibrary* cros = CrosLibrary::Get()->GetNetworkLibrary();
135 UpdateState(cros); 135 UpdateState(cros);
136 cros->AddNetworkManagerObserver(this); 136 cros->AddNetworkManagerObserver(this);
137 registrar_.Add(this, 137 registrar_.Add(this,
138 chrome::NOTIFICATION_LOGIN_PROXY_CHANGED, 138 chrome::NOTIFICATION_LOGIN_PROXY_CHANGED,
139 NotificationService::AllSources()); 139 content::NotificationService::AllSources());
140 } 140 }
141 141
142 NetworkStateInformer::~NetworkStateInformer() { 142 NetworkStateInformer::~NetworkStateInformer() {
143 CrosLibrary::Get()->GetNetworkLibrary()-> 143 CrosLibrary::Get()->GetNetworkLibrary()->
144 RemoveNetworkManagerObserver(this); 144 RemoveNetworkManagerObserver(this);
145 } 145 }
146 146
147 void NetworkStateInformer::AddObserver(const std::string& callback) { 147 void NetworkStateInformer::AddObserver(const std::string& callback) {
148 observers_.insert(callback); 148 observers_.insert(callback);
149 } 149 }
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 users_list.Append(guest_dict); 616 users_list.Append(guest_dict);
617 } 617 }
618 618
619 // Call the Javascript callback 619 // Call the Javascript callback
620 base::FundamentalValue animated_value(animated); 620 base::FundamentalValue animated_value(animated);
621 web_ui_->CallJavascriptFunction("login.AccountPickerScreen.loadUsers", 621 web_ui_->CallJavascriptFunction("login.AccountPickerScreen.loadUsers",
622 users_list, animated_value); 622 users_list, animated_value);
623 } 623 }
624 624
625 void SigninScreenHandler::HandleLoginWebuiReady(const base::ListValue* args) { 625 void SigninScreenHandler::HandleLoginWebuiReady(const base::ListValue* args) {
626 NotificationService::current()->Notify( 626 content::NotificationService::current()->Notify(
627 chrome::NOTIFICATION_LOGIN_WEBUI_READY, 627 chrome::NOTIFICATION_LOGIN_WEBUI_READY,
628 NotificationService::AllSources(), 628 content::NotificationService::AllSources(),
629 NotificationService::NoDetails()); 629 content::NotificationService::NoDetails());
630 } 630 }
631 631
632 void SigninScreenHandler::HandleLoginRequestNetworkState( 632 void SigninScreenHandler::HandleLoginRequestNetworkState(
633 const base::ListValue* args) { 633 const base::ListValue* args) {
634 std::string callback; 634 std::string callback;
635 std::string reason; 635 std::string reason;
636 if (!args->GetString(0, &callback) || !args->GetString(1, &reason)) { 636 if (!args->GetString(0, &callback) || !args->GetString(1, &reason)) {
637 NOTREACHED(); 637 NOTREACHED();
638 return; 638 return;
639 } 639 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 684
685 cookie_remover_ = new BrowsingDataRemover( 685 cookie_remover_ = new BrowsingDataRemover(
686 Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context()), 686 Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context()),
687 BrowsingDataRemover::EVERYTHING, 687 BrowsingDataRemover::EVERYTHING,
688 base::Time()); 688 base::Time());
689 cookie_remover_->AddObserver(this); 689 cookie_remover_->AddObserver(this);
690 cookie_remover_->Remove(BrowsingDataRemover::REMOVE_SITE_DATA); 690 cookie_remover_->Remove(BrowsingDataRemover::REMOVE_SITE_DATA);
691 } 691 }
692 692
693 } // namespace chromeos 693 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chrome_url_data_manager_browsertest.cc ('k') | chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698