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

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

Issue 6542003: Refactor WebResourceService class, making it more generic. Move all the prom... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: For the records 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
« no previous file with comments | « no previous file | chrome/browser/dom_ui/ntp_resource_cache.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include "chrome/browser/dom_ui/new_tab_ui.h" 7 #include "chrome/browser/dom_ui/new_tab_ui.h"
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 266
267 void NewTabPageClosePromoHandler::RegisterMessages() { 267 void NewTabPageClosePromoHandler::RegisterMessages() {
268 dom_ui_->RegisterMessageCallback("closePromo", NewCallback( 268 dom_ui_->RegisterMessageCallback("closePromo", NewCallback(
269 this, &NewTabPageClosePromoHandler::HandleClosePromo)); 269 this, &NewTabPageClosePromoHandler::HandleClosePromo));
270 } 270 }
271 271
272 void NewTabPageClosePromoHandler::HandleClosePromo( 272 void NewTabPageClosePromoHandler::HandleClosePromo(
273 const ListValue* args) { 273 const ListValue* args) {
274 dom_ui_->GetProfile()->GetPrefs()->SetBoolean(prefs::kNTPPromoClosed, true); 274 dom_ui_->GetProfile()->GetPrefs()->SetBoolean(prefs::kNTPPromoClosed, true);
275 NotificationService* service = NotificationService::current(); 275 NotificationService* service = NotificationService::current();
276 service->Notify(NotificationType::WEB_RESOURCE_STATE_CHANGED, 276 service->Notify(NotificationType::PROMO_RESOURCE_STATE_CHANGED,
277 Source<NewTabPageClosePromoHandler>(this), 277 Source<NewTabPageClosePromoHandler>(this),
278 NotificationService::NoDetails()); 278 NotificationService::NoDetails());
279 } 279 }
280 280
281 } // namespace 281 } // namespace
282 282
283 /////////////////////////////////////////////////////////////////////////////// 283 ///////////////////////////////////////////////////////////////////////////////
284 // NewTabUI 284 // NewTabUI
285 285
286 NewTabUI::NewTabUI(TabContents* contents) 286 NewTabUI::NewTabUI(TabContents* contents)
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 591
592 scoped_refptr<RefCountedBytes> html_bytes( 592 scoped_refptr<RefCountedBytes> html_bytes(
593 profile_->GetNTPResourceCache()->GetNewTabHTML(is_off_the_record)); 593 profile_->GetNTPResourceCache()->GetNewTabHTML(is_off_the_record));
594 594
595 SendResponse(request_id, html_bytes); 595 SendResponse(request_id, html_bytes);
596 } 596 }
597 597
598 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const { 598 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const {
599 return "text/html"; 599 return "text/html";
600 } 600 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/dom_ui/ntp_resource_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698