Skip to content

Commit

Permalink
browser: Put simple_message_box.h and chrome_web_contents_view_delega…
Browse files Browse the repository at this point in the history
…te.h into chrome namespace.

BUG=133088
TBR=ben@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10689095

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145421 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
tfarina@chromium.org committed Jul 4, 2012
1 parent 1467cfe commit d332202
Show file tree
Hide file tree
Showing 22 changed files with 59 additions and 61 deletions.
8 changes: 4 additions & 4 deletions chrome/browser/bookmarks/bookmark_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ bool ShouldOpenAll(gfx::NativeWindow parent,
if (child_count < bookmark_utils::num_urls_before_prompting)
return true;

return browser::ShowMessageBox(parent,
return chrome::ShowMessageBox(parent,
l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
l10n_util::GetStringFUTF16(IDS_BOOKMARK_BAR_SHOULD_OPEN_ALL,
base::IntToString16(child_count)),
browser::MESSAGE_BOX_TYPE_QUESTION) == browser::MESSAGE_BOX_RESULT_YES;
chrome::MESSAGE_BOX_TYPE_QUESTION) == chrome::MESSAGE_BOX_RESULT_YES;
}

// Comparison function that compares based on date modified of the two nodes.
Expand Down Expand Up @@ -710,11 +710,11 @@ bool NodeHasURLs(const BookmarkNode* node) {
bool ConfirmDeleteBookmarkNode(const BookmarkNode* node,
gfx::NativeWindow window) {
DCHECK(node && node->is_folder() && !node->empty());
return browser::ShowMessageBox(window,
return chrome::ShowMessageBox(window,
l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
l10n_util::GetStringFUTF16Int(IDS_BOOKMARK_EDITOR_CONFIRM_DELETE,
ChildURLCountTotal(node)),
browser::MESSAGE_BOX_TYPE_QUESTION) == browser::MESSAGE_BOX_RESULT_YES;
chrome::MESSAGE_BOX_TYPE_QUESTION) == chrome::MESSAGE_BOX_RESULT_YES;
}

void DeleteBookmarkFolders(BookmarkModel* model,
Expand Down
17 changes: 8 additions & 9 deletions chrome/browser/chrome_browser_main_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,18 @@ void RecordBreakpadStatusUMA(MetricsService* metrics) {

void WarnAboutMinimumSystemRequirements() {
if (base::win::GetVersion() < base::win::VERSION_XP) {
const string16 title = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME);
const string16 message =
l10n_util::GetStringUTF16(IDS_UNSUPPORTED_OS_PRE_WIN_XP);
browser::ShowMessageBox(NULL, title, message,
browser::MESSAGE_BOX_TYPE_WARNING);
chrome::ShowMessageBox(NULL,
l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
l10n_util::GetStringUTF16(IDS_UNSUPPORTED_OS_PRE_WIN_XP),
chrome::MESSAGE_BOX_TYPE_WARNING);
}
}

void ShowCloseBrowserFirstMessageBox() {
const string16 title = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME);
const string16 message = l10n_util::GetStringUTF16(IDS_UNINSTALL_CLOSE_APP);
browser::ShowMessageBox(NULL, title, message,
browser::MESSAGE_BOX_TYPE_WARNING);
chrome::ShowMessageBox(NULL,
l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
l10n_util::GetStringUTF16(IDS_UNINSTALL_CLOSE_APP),
chrome::MESSAGE_BOX_TYPE_WARNING);
}

int DoUninstallTasks(bool chrome_still_running) {
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/chrome_content_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ content::WebContentsView*
content::WebContentsViewDelegate*
ChromeContentBrowserClient::GetWebContentsViewDelegate(
content::WebContents* web_contents) {
return browser::CreateWebContentsViewDelegate(web_contents);
return chrome::CreateWebContentsViewDelegate(web_contents);
}

void ChromeContentBrowserClient::RenderViewHostCreated(
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/chromeos/extensions/file_manager_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,13 @@ void ShowWarningMessageBox(Profile* profile, const FilePath& path) {
// TODO: if FindOrCreateTabbedBrowser creates a new browser the returned
// browser is leaked.
Browser* browser = browser::FindOrCreateTabbedBrowser(profile);
browser::ShowMessageBox(
chrome::ShowMessageBox(
browser->window()->GetNativeWindow(),
l10n_util::GetStringFUTF16(
IDS_FILE_BROWSER_ERROR_VIEWING_FILE_TITLE,
UTF8ToUTF16(path.BaseName().value())),
l10n_util::GetStringUTF16(IDS_FILE_BROWSER_ERROR_VIEWING_FILE),
browser::MESSAGE_BOX_TYPE_WARNING);
chrome::MESSAGE_BOX_TYPE_WARNING);
}

// Called when a file on GData was found. Opens the file found at |file_path|
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/extensions/extension_error_reporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ void ExtensionErrorReporter::ReportError(const string16& message,
LOG(ERROR) << "Extension error: " << message;

if (enable_noisy_errors_ && be_noisy) {
browser::ShowMessageBox(NULL, ASCIIToUTF16("Extension error"), message,
browser::MESSAGE_BOX_TYPE_WARNING);
chrome::ShowMessageBox(NULL, ASCIIToUTF16("Extension error"), message,
chrome::MESSAGE_BOX_TYPE_WARNING);
}
}

Expand Down
8 changes: 4 additions & 4 deletions chrome/browser/extensions/extensions_startup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ void ExtensionsStartupUtil::OnPackSuccess(
const FilePath& crx_path,
const FilePath& output_private_key_path) {
pack_job_succeeded_ = true;
browser::ShowMessageBox(NULL, ASCIIToUTF16("Extension Packaging Success"),
chrome::ShowMessageBox(NULL, ASCIIToUTF16("Extension Packaging Success"),
PackExtensionJob::StandardSuccessMessage(crx_path,
output_private_key_path),
browser::MESSAGE_BOX_TYPE_INFORMATION);
chrome::MESSAGE_BOX_TYPE_INFORMATION);
}

void ExtensionsStartupUtil::OnPackFailure(const std::string& error_message,
ExtensionCreator::ErrorType type) {
browser::ShowMessageBox(NULL, ASCIIToUTF16("Extension Packaging Error"),
UTF8ToUTF16(error_message), browser::MESSAGE_BOX_TYPE_WARNING);
chrome::ShowMessageBox(NULL, ASCIIToUTF16("Extension Packaging Error"),
UTF8ToUTF16(error_message), chrome::MESSAGE_BOX_TYPE_WARNING);
}

bool ExtensionsStartupUtil::PackExtension(const CommandLine& cmd_line) {
Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/hang_monitor/hung_plugin_action.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ bool HungPluginAction::OnHungWindowDetected(HWND hung_window,
HungWindowResponseCallback,
reinterpret_cast<ULONG_PTR>(this));
current_hung_plugin_window_ = hung_window;
if (browser::ShowMessageBox(NULL, title, message,
browser::MESSAGE_BOX_TYPE_QUESTION) ==
browser::MESSAGE_BOX_RESULT_YES) {
if (chrome::ShowMessageBox(NULL, title, message,
chrome::MESSAGE_BOX_TYPE_QUESTION) ==
chrome::MESSAGE_BOX_RESULT_YES) {
*action = HungWindowNotification::HUNG_WINDOW_TERMINATE_PROCESS;
} else {
// If the user choses to ignore the hung window warning, the
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/importer/importer_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ void ImporterHost::StartImportSettings(
void ImporterHost::OnGoogleGAIACookieChecked(bool result) {
#if defined(OS_WIN)
if (!result) {
browser::ShowMessageBox(NULL,
chrome::ShowMessageBox(NULL,
l10n_util::GetStringUTF16(IDS_IMPORTER_GOOGLE_LOGIN_TEXT), string16(),
browser::MESSAGE_BOX_TYPE_INFORMATION);
chrome::MESSAGE_BOX_TYPE_INFORMATION);

GURL url("https://accounts.google.com/ServiceLogin");
DCHECK(profile_);
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/pepper_gtalk_message_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ void PepperGtalkMessageFilter::OnTalkGetPermission(uint32 plugin_dispatcher_id,
aura::Window* parent = ash::Shell::GetContainer(
ash::Shell::GetActiveRootWindow(),
ash::internal::kShellWindowId_SystemModalContainer);
user_response = browser::ShowMessageBox(parent, title, message,
browser::MESSAGE_BOX_TYPE_QUESTION) == browser::MESSAGE_BOX_RESULT_YES;
user_response = chrome::ShowMessageBox(parent, title, message,
chrome::MESSAGE_BOX_TYPE_QUESTION) == chrome::MESSAGE_BOX_RESULT_YES;
#else
NOTIMPLEMENTED();
#endif
Expand Down
9 changes: 4 additions & 5 deletions chrome/browser/printing/print_error_dialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
namespace chrome {

void ShowPrintErrorDialog(gfx::NativeWindow parent) {
browser::ShowMessageBox(
parent,
l10n_util::GetStringUTF16(IDS_PRINT_SPOOL_FAILED_TITLE_TEXT),
l10n_util::GetStringUTF16(IDS_PRINT_SPOOL_FAILED_ERROR_TEXT),
browser::MESSAGE_BOX_TYPE_WARNING);
ShowMessageBox(parent,
l10n_util::GetStringUTF16(IDS_PRINT_SPOOL_FAILED_TITLE_TEXT),
l10n_util::GetStringUTF16(IDS_PRINT_SPOOL_FAILED_ERROR_TEXT),
MESSAGE_BOX_TYPE_WARNING);
}

} // namespace chrome
4 changes: 2 additions & 2 deletions chrome/browser/process_singleton_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,10 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() {
reinterpret_cast<LPARAM>(&visible_window));

// If there is a visible browser window, ask the user before killing it.
if (visible_window && browser::ShowMessageBox(NULL,
if (visible_window && chrome::ShowMessageBox(NULL,
l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
l10n_util::GetStringUTF16(IDS_BROWSER_HUNGBROWSER_MESSAGE),
browser::MESSAGE_BOX_TYPE_QUESTION) == browser::MESSAGE_BOX_RESULT_NO) {
chrome::MESSAGE_BOX_TYPE_QUESTION) == chrome::MESSAGE_BOX_RESULT_NO) {
// The user denied. Quit silently.
return PROCESS_NOTIFIED;
}
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/ui/cocoa/simple_message_box_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util_mac.h"

namespace browser {
namespace chrome {

MessageBoxResult ShowMessageBox(gfx::NativeWindow parent,
const string16& title,
Expand All @@ -35,4 +35,4 @@ MessageBoxResult ShowMessageBox(gfx::NativeWindow parent,
MESSAGE_BOX_RESULT_NO : MESSAGE_BOX_RESULT_YES;
}

} // namespace browser
} // namespace chrome
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ new RenderViewContextMenuMac(web_contents_,
context_menu_->Init();
}

namespace browser {
namespace chrome {

content::WebContentsViewDelegate* CreateWebContentsViewDelegate(
content::WebContents* web_contents) {
return new ChromeWebContentsViewDelegateMac(web_contents);
}

} // namespace browser
} // namespace chrome
4 changes: 2 additions & 2 deletions chrome/browser/ui/gtk/simple_message_box_gtk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void OnDialogResponse(GtkWidget* widget, int response, void* user_data) {

} // namespace

namespace browser {
namespace chrome {

MessageBoxResult ShowMessageBox(gfx::NativeWindow parent,
const string16& title,
Expand Down Expand Up @@ -82,4 +82,4 @@ MessageBoxResult ShowMessageBox(gfx::NativeWindow parent,
return MESSAGE_BOX_RESULT_YES;
}

} // namespace browser
} // namespace chrome
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,11 @@ void ChromeWebContentsViewDelegateGtk::OnSetFloatingPosition(
g_value_unset(&value);
}

namespace browser {
namespace chrome {

content::WebContentsViewDelegate* CreateWebContentsViewDelegate(
content::WebContents* web_contents) {
return new ChromeWebContentsViewDelegateGtk(web_contents);
}

} // namespace browser
} // namespace chrome
8 changes: 4 additions & 4 deletions chrome/browser/ui/profile_error_dialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ void ShowProfileErrorDialog(int message_id) {
#if defined(OS_ANDROID)
NOTIMPLEMENTED();
#else
browser::ShowMessageBox(NULL,
l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
l10n_util::GetStringUTF16(message_id),
browser::MESSAGE_BOX_TYPE_WARNING);
chrome::ShowMessageBox(NULL,
l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
l10n_util::GetStringUTF16(message_id),
chrome::MESSAGE_BOX_TYPE_WARNING);
#endif
}
4 changes: 2 additions & 2 deletions chrome/browser/ui/simple_message_box.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "base/string16.h"
#include "ui/gfx/native_widget_types.h"

namespace browser {
namespace chrome {

enum MessageBoxResult {
MESSAGE_BOX_RESULT_NO = 0,
Expand All @@ -35,6 +35,6 @@ MessageBoxResult ShowMessageBox(gfx::NativeWindow parent,
const string16& message,
MessageBoxType type);

} // namespace browser
} // namespace chrome

#endif // CHROME_BROWSER_UI_SIMPLE_MESSAGE_BOX_H_
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

namespace content {
class WebContents;
class WebContentsViewMacDelegate;
class WebContentsViewDelegate;
}

namespace browser {
namespace chrome {

content::WebContentsViewDelegate* CreateWebContentsViewDelegate(
content::WebContents* web_contents);

} // namespace
} // namespace chrome

#endif // CHROME_BROWSER_UI_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_H_
4 changes: 2 additions & 2 deletions chrome/browser/ui/views/simple_message_box_views.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "ui/aura/root_window.h"
#endif

namespace browser {
namespace chrome {

namespace {

Expand Down Expand Up @@ -187,4 +187,4 @@ MessageBoxResult ShowMessageBox(gfx::NativeWindow parent,
return dialog->result();
}

} // namespace browser
} // namespace chrome
4 changes: 2 additions & 2 deletions chrome/browser/ui/views/simple_message_box_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "ui/base/win/message_box_win.h"

namespace browser {
namespace chrome {

MessageBoxResult ShowMessageBox(gfx::NativeWindow parent,
const string16& title,
Expand All @@ -20,4 +20,4 @@ MessageBoxResult ShowMessageBox(gfx::NativeWindow parent,
MESSAGE_BOX_RESULT_NO : MESSAGE_BOX_RESULT_YES;
}

} // namespace browser
} // namespace chrome
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,11 @@ void ChromeWebContentsViewDelegateViews::SetInitialFocus() {
}
}

namespace browser {
namespace chrome {

content::WebContentsViewDelegate* CreateWebContentsViewDelegate(
content::WebContents* web_contents) {
return new ChromeWebContentsViewDelegateViews(web_contents);
}

} // namespace browser
} // namespace chrome
4 changes: 2 additions & 2 deletions chrome/browser/ui/webui/chromeos/mobile_setup_dialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ void MobileSetupDialogDelegate::OnCloseContents(WebContents* source,
return;
}

*out_close_dialog = browser::ShowMessageBox(dialog_window_,
*out_close_dialog = chrome::ShowMessageBox(dialog_window_,
l10n_util::GetStringUTF16(IDS_MOBILE_SETUP_TITLE),
l10n_util::GetStringUTF16(IDS_MOBILE_CANCEL_ACTIVATION),
browser::MESSAGE_BOX_TYPE_QUESTION);
chrome::MESSAGE_BOX_TYPE_QUESTION);
}

bool MobileSetupDialogDelegate::ShouldShowDialogTitle() const {
Expand Down

0 comments on commit d332202

Please sign in to comment.