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

Side by Side Diff: chrome/browser/extensions/apps_promo.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/extensions/apps_promo.h" 5 #include "chrome/browser/extensions/apps_promo.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
11 #include "chrome/browser/prefs/pref_service.h" 11 #include "chrome/browser/prefs/pref_service.h"
12 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/ui/webui/ntp/shown_sections_handler.h" 13 #include "chrome/browser/ui/webui/ntp/shown_sections_handler.h"
14 #include "chrome/common/chrome_switches.h" 14 #include "chrome/common/chrome_switches.h"
15 #include "chrome/common/extensions/extension.h" 15 #include "chrome/common/extensions/extension.h"
16 #include "chrome/common/chrome_notification_types.h" 16 #include "chrome/common/chrome_notification_types.h"
17 #include "chrome/common/pref_names.h" 17 #include "chrome/common/pref_names.h"
18 #include "content/common/notification_service.h" 18 #include "content/public/browser/notification_service.h"
19 #include "content/public/common/url_constants.h" 19 #include "content/public/common/url_constants.h"
20 #include "net/base/load_flags.h" 20 #include "net/base/load_flags.h"
21 #include "net/url_request/url_request_status.h" 21 #include "net/url_request/url_request_status.h"
22 22
23 const int AppsPromo::kDefaultAppsCounterMax = 10; 23 const int AppsPromo::kDefaultAppsCounterMax = 10;
24 24
25 namespace { 25 namespace {
26 26
27 // The default logo for the promo. 27 // The default logo for the promo.
28 const char kDefaultLogo[] = "chrome://theme/IDR_WEBSTORE_ICON"; 28 const char kDefaultLogo[] = "chrome://theme/IDR_WEBSTORE_ICON";
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 url_fetcher_->Start(); 381 url_fetcher_->Start();
382 } 382 }
383 383
384 bool AppsPromoLogoFetcher::HaveCachedLogo() { 384 bool AppsPromoLogoFetcher::HaveCachedLogo() {
385 return promo_data_.logo == AppsPromo::GetSourcePromoLogoURL(); 385 return promo_data_.logo == AppsPromo::GetSourcePromoLogoURL();
386 } 386 }
387 387
388 void AppsPromoLogoFetcher::SavePromo() { 388 void AppsPromoLogoFetcher::SavePromo() {
389 AppsPromo::SetPromo(promo_data_); 389 AppsPromo::SetPromo(promo_data_);
390 390
391 NotificationService::current()->Notify( 391 content::NotificationService::current()->Notify(
392 chrome::NOTIFICATION_WEB_STORE_PROMO_LOADED, 392 chrome::NOTIFICATION_WEB_STORE_PROMO_LOADED,
393 content::Source<Profile>(profile_), 393 content::Source<Profile>(profile_),
394 NotificationService::NoDetails()); 394 content::NotificationService::NoDetails());
395 } 395 }
396 396
397 bool AppsPromoLogoFetcher::SupportsLogoURL() { 397 bool AppsPromoLogoFetcher::SupportsLogoURL() {
398 URLPattern allowed_urls(URLPattern::SCHEME_HTTPS, kValidLogoPattern); 398 URLPattern allowed_urls(URLPattern::SCHEME_HTTPS, kValidLogoPattern);
399 return allowed_urls.MatchesURL(promo_data_.logo); 399 return allowed_urls.MatchesURL(promo_data_.logo);
400 } 400 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/app_process_apitest.cc ('k') | chrome/browser/extensions/browser_action_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698