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

Unified Diff: chrome/browser/cocoa/browser_window_cocoa.mm

Issue 418040: Mac: Implement profile error dialog. (Closed)
Patch Set: done Created 11 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/browser_window_cocoa.mm
diff --git a/chrome/browser/cocoa/browser_window_cocoa.mm b/chrome/browser/cocoa/browser_window_cocoa.mm
index d7d19d56899c220c963bcb421b792812a4e1ab7e..b6cb0ba7d50222573b302e885fa58d2b1f7fa81e 100644
--- a/chrome/browser/cocoa/browser_window_cocoa.mm
+++ b/chrome/browser/cocoa/browser_window_cocoa.mm
@@ -2,11 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "app/l10n_util_mac.h"
#include "base/gfx/rect.h"
#include "base/logging.h"
#include "base/sys_string_conversions.h"
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/browser/bookmarks/bookmark_utils.h"
+#include "chrome/browser/browser_list.h"
#include "chrome/browser/cocoa/browser_window_cocoa.h"
#import "chrome/browser/cocoa/browser_window_controller.h"
#import "chrome/browser/cocoa/bug_report_window_controller.h"
@@ -29,6 +31,8 @@
#include "chrome/common/pref_service.h"
#include "chrome/common/temp_scaffolding_stubs.h"
#include "chrome/browser/profile.h"
+#include "grit/chromium_strings.h"
+#include "grit/generated_resources.h"
BrowserWindowCocoa::BrowserWindowCocoa(Browser* browser,
BrowserWindowController* controller,
@@ -45,6 +49,14 @@ BrowserWindowCocoa::~BrowserWindowCocoa() {
}
void BrowserWindowCocoa::Show() {
+ // The Browser associated with this browser window must become the active
+ // browser at the time Show() is called. This is the natural behaviour under
viettrungluu 2009/11/21 07:32:38 That should be "|Show()|", I suppose.
+ // Windows, but |makeKeyAndOrderFront:| won't send |windowDidBecomeMain:|
viettrungluu 2009/11/21 07:32:38 One day (apparently today), I'll point out that th
+ // until we return to the runloop. Therefore any calls to
+ // BrowserList::GetLastActive() (for example, in bookmark_util), will return
viettrungluu 2009/11/21 07:32:38 |...| here to.
+ // the previous browser instead if we don't explicitly set it here.
+ BrowserList::SetLastActive(browser_);
+
[window_ makeKeyAndOrderFront:controller_];
}
@@ -303,7 +315,12 @@ void BrowserWindowCocoa::ShowRepostFormWarningDialog(
}
void BrowserWindowCocoa::ShowProfileErrorDialog(int message_id) {
- NOTIMPLEMENTED();
+ scoped_nsobject<NSAlert> alert([[NSAlert alloc] init]);
+ [alert addButtonWithTitle:l10n_util::GetNSStringWithFixup(IDS_OK)];
+ [alert setMessageText:l10n_util::GetNSStringWithFixup(IDS_PRODUCT_NAME)];
+ [alert setInformativeText:l10n_util::GetNSStringWithFixup(message_id)];
+ [alert setAlertStyle:NSWarningAlertStyle];
+ [alert runModal];
}
void BrowserWindowCocoa::ShowThemeInstallBubble() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698