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

Unified Diff: chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm

Issue 23618036: Merge NOTIFICATION_RENDER_VIEW_HOST_CHANGED into NOTIFICATION_WEB_CONTENTS_SWAPPED. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm
index 6a5c58d4f2217c00638d17f5d1831ed326f1a2e1..73d995a652307f8edc880ace65e24aa7edd8749a 100644
--- a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm
@@ -16,8 +16,6 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension.h"
#include "content/public/browser/native_web_keyboard_event.h"
-#include "content/public/browser/notification_source.h"
-#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
@@ -257,13 +255,15 @@ NativeAppWindowCocoa::NativeAppWindowCocoa(
is_fullscreen_(false),
attention_request_id_(0),
use_system_drag_(true) {
+ Observe(web_contents());
+
// Flip coordinates based on the primary screen.
NSRect main_screen_rect = [[[NSScreen screens] objectAtIndex:0] frame];
NSRect cocoa_bounds = NSMakeRect(params.bounds.x(),
NSHeight(main_screen_rect) - params.bounds.y() - params.bounds.height(),
params.bounds.width(), params.bounds.height());
- // If coordinates are < 0, center window on primary screen
+ // If coordinates are < 0, center window on primary screen.
if (params.bounds.x() == INT_MIN) {
cocoa_bounds.origin.x =
floor((NSWidth(main_screen_rect) - NSWidth(cocoa_bounds)) / 2);
@@ -782,7 +782,9 @@ bool NativeAppWindowCocoa::IsAlwaysOnTop() const {
return false;
}
-void NativeAppWindowCocoa::RenderViewHostChanged() {
+void NativeAppWindowCocoa::RenderViewHostChanged(
+ content::RenderViewHost* old_host,
+ content::RenderViewHost* new_host) {
web_contents()->GetView()->Focus();
}
« no previous file with comments | « chrome/browser/ui/cocoa/apps/native_app_window_cocoa.h ('k') | chrome/browser/ui/gtk/apps/native_app_window_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698