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

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

Issue 1061003: [Mac] Makes ctrl-return follow links when finding in page.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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
« no previous file with comments | « chrome/browser/cocoa/find_bar_bridge.h ('k') | chrome/browser/cocoa/find_bar_cocoa_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/find_bar_bridge.mm
===================================================================
--- chrome/browser/cocoa/find_bar_bridge.mm (revision 42265)
+++ chrome/browser/cocoa/find_bar_bridge.mm (working copy)
@@ -1,27 +1,33 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#import "chrome/browser/cocoa/find_bar_bridge.h"
+#include "chrome/browser/cocoa/find_bar_bridge.h"
#include "base/sys_string_conversions.h"
#import "chrome/browser/cocoa/find_bar_cocoa_controller.h"
+// static
+bool FindBarBridge::disable_animations_during_testing_ = false;
+
FindBarBridge::FindBarBridge()
: find_bar_controller_(NULL) {
- cocoa_controller_.reset([[FindBarCocoaController alloc] init]);
+ cocoa_controller_ = [[FindBarCocoaController alloc] init];
[cocoa_controller_ setFindBarBridge:this];
}
FindBarBridge::~FindBarBridge() {
+ [cocoa_controller_ release];
}
void FindBarBridge::Show(bool animate) {
- [cocoa_controller_ showFindBar:(animate ? YES : NO)];
+ bool really_animate = animate && !disable_animations_during_testing_;
+ [cocoa_controller_ showFindBar:(really_animate ? YES : NO)];
}
void FindBarBridge::Hide(bool animate) {
- [cocoa_controller_ hideFindBar:(animate ? YES : NO)];
+ bool really_animate = animate && !disable_animations_during_testing_;
+ [cocoa_controller_ hideFindBar:(really_animate ? YES : NO)];
}
void FindBarBridge::SetFocusAndSelection() {
@@ -63,3 +69,17 @@
void FindBarBridge::RestoreSavedFocus() {
[cocoa_controller_ restoreSavedFocus];
}
+
+bool FindBarBridge::GetFindBarWindowInfo(gfx::Point* position,
+ bool* fully_visible) {
+ // TODO(rohitrao): Return the proper position. http://crbug.com/22036
+ *position = gfx::Point(0, 0);
+
+ NSWindow* window = [[cocoa_controller_ view] window];
+ bool window_visible = [window isVisible] ? true : false;
+ *fully_visible = window_visible &&
+ [cocoa_controller_ isFindBarVisible] &&
+ ![cocoa_controller_ isFindBarAnimating];
+
+ return window_visible;
+}
« no previous file with comments | « chrome/browser/cocoa/find_bar_bridge.h ('k') | chrome/browser/cocoa/find_bar_cocoa_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698