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

Side by Side Diff: chrome/browser/extensions/extension_install_ui.cc

Issue 9003014: Replace WebUI::tab_contents() with web_contents() and switch all users to use web_contents.h inst... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 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) 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/extension_install_ui.h" 5 #include "chrome/browser/extensions/extension_install_ui.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 23 matching lines...) Expand all
34 #include "chrome/common/extensions/extension_resource.h" 34 #include "chrome/common/extensions/extension_resource.h"
35 #include "chrome/common/extensions/url_pattern.h" 35 #include "chrome/common/extensions/url_pattern.h"
36 #include "chrome/common/url_constants.h" 36 #include "chrome/common/url_constants.h"
37 #include "content/public/browser/notification_service.h" 37 #include "content/public/browser/notification_service.h"
38 #include "grit/chromium_strings.h" 38 #include "grit/chromium_strings.h"
39 #include "grit/generated_resources.h" 39 #include "grit/generated_resources.h"
40 #include "grit/theme_resources.h" 40 #include "grit/theme_resources.h"
41 #include "ui/base/l10n/l10n_util.h" 41 #include "ui/base/l10n/l10n_util.h"
42 #include "ui/base/resource/resource_bundle.h" 42 #include "ui/base/resource/resource_bundle.h"
43 43
44 using content::WebContents;
45
44 static const int kTitleIds[ExtensionInstallUI::NUM_PROMPT_TYPES] = { 46 static const int kTitleIds[ExtensionInstallUI::NUM_PROMPT_TYPES] = {
45 0, 47 0,
46 IDS_EXTENSION_INLINE_INSTALL_PROMPT_TITLE, 48 IDS_EXTENSION_INLINE_INSTALL_PROMPT_TITLE,
47 IDS_EXTENSION_RE_ENABLE_PROMPT_TITLE, 49 IDS_EXTENSION_RE_ENABLE_PROMPT_TITLE,
48 IDS_EXTENSION_PERMISSIONS_PROMPT_TITLE 50 IDS_EXTENSION_PERMISSIONS_PROMPT_TITLE
49 }; 51 };
50 static const int kHeadingIds[ExtensionInstallUI::NUM_PROMPT_TYPES] = { 52 static const int kHeadingIds[ExtensionInstallUI::NUM_PROMPT_TYPES] = {
51 IDS_EXTENSION_INSTALL_PROMPT_HEADING, 53 IDS_EXTENSION_INSTALL_PROMPT_HEADING,
52 IDS_EXTENSION_INSTALL_PROMPT_HEADING, 54 IDS_EXTENSION_INSTALL_PROMPT_HEADING,
53 IDS_EXTENSION_RE_ENABLE_PROMPT_HEADING, 55 IDS_EXTENSION_RE_ENABLE_PROMPT_HEADING,
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 355
354 // static 356 // static
355 void ExtensionInstallUI::OpenAppInstalledNTP(Browser* browser, 357 void ExtensionInstallUI::OpenAppInstalledNTP(Browser* browser,
356 const std::string& app_id) { 358 const std::string& app_id) {
357 browser::NavigateParams params = 359 browser::NavigateParams params =
358 browser->GetSingletonTabNavigateParams(GURL(chrome::kChromeUINewTabURL)); 360 browser->GetSingletonTabNavigateParams(GURL(chrome::kChromeUINewTabURL));
359 browser::Navigate(&params); 361 browser::Navigate(&params);
360 362
361 content::NotificationService::current()->Notify( 363 content::NotificationService::current()->Notify(
362 chrome::NOTIFICATION_APP_INSTALLED_TO_NTP, 364 chrome::NOTIFICATION_APP_INSTALLED_TO_NTP,
363 content::Source<TabContents>(params.target_contents->tab_contents()), 365 content::Source<WebContents>(params.target_contents->web_contents()),
364 content::Details<const std::string>(&app_id)); 366 content::Details<const std::string>(&app_id));
365 } 367 }
366 368
367 // static 369 // static
368 void ExtensionInstallUI::DisableFailureUIForTests() { 370 void ExtensionInstallUI::DisableFailureUIForTests() {
369 disable_failure_ui_for_tests = true; 371 disable_failure_ui_for_tests = true;
370 } 372 }
371 373
372 void ExtensionInstallUI::ShowThemeInfoBar(const std::string& previous_theme_id, 374 void ExtensionInstallUI::ShowThemeInfoBar(const std::string& previous_theme_id,
373 bool previous_using_native_theme, 375 bool previous_using_native_theme,
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 bool previous_using_native_theme) { 433 bool previous_using_native_theme) {
432 Profile* profile = tab_contents->profile(); 434 Profile* profile = tab_contents->profile();
433 return new ThemeInstalledInfoBarDelegate( 435 return new ThemeInstalledInfoBarDelegate(
434 tab_contents->infobar_tab_helper(), 436 tab_contents->infobar_tab_helper(),
435 profile->GetExtensionService(), 437 profile->GetExtensionService(),
436 ThemeServiceFactory::GetForProfile(profile), 438 ThemeServiceFactory::GetForProfile(profile),
437 new_theme, 439 new_theme,
438 previous_theme_id, 440 previous_theme_id,
439 previous_using_native_theme); 441 previous_using_native_theme);
440 } 442 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/screen_locker_tester.cc ('k') | chrome/browser/extensions/extension_web_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698