OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/mac/bundle_locations.h" | 8 #include "base/mac/bundle_locations.h" |
9 #include "base/mac/mac_util.h" | 9 #include "base/mac/mac_util.h" |
10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
| 11 #include "grit/theme_resources.h" |
11 #include "grit/ui_resources.h" | 12 #include "grit/ui_resources.h" |
12 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/ui/browser_finder.h" | 14 #include "chrome/browser/ui/browser_finder.h" |
14 #include "chrome/browser/ui/browser_window.h" | 15 #include "chrome/browser/ui/browser_window.h" |
15 #include "chrome/browser/ui/cocoa/browser_window_controller.h" | 16 #include "chrome/browser/ui/cocoa/browser_window_controller.h" |
16 #import "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" | 17 #import "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" |
17 #import "chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.h" | 18 #import "chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.h" |
18 #import "chrome/browser/ui/cocoa/find_bar/find_bar_text_field.h" | 19 #import "chrome/browser/ui/cocoa/find_bar/find_bar_text_field.h" |
19 #import "chrome/browser/ui/cocoa/find_bar/find_bar_text_field_cell.h" | 20 #import "chrome/browser/ui/cocoa/find_bar/find_bar_text_field_cell.h" |
20 #import "chrome/browser/ui/cocoa/image_button_cell.h" | 21 #import "chrome/browser/ui/cocoa/image_button_cell.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 [[NSNotificationCenter defaultCenter] removeObserver:self]; | 123 [[NSNotificationCenter defaultCenter] removeObserver:self]; |
123 [super dealloc]; | 124 [super dealloc]; |
124 } | 125 } |
125 | 126 |
126 - (void)setFindBarBridge:(FindBarBridge*)findBarBridge { | 127 - (void)setFindBarBridge:(FindBarBridge*)findBarBridge { |
127 DCHECK(!findBarBridge_); // should only be called once. | 128 DCHECK(!findBarBridge_); // should only be called once. |
128 findBarBridge_ = findBarBridge; | 129 findBarBridge_ = findBarBridge; |
129 } | 130 } |
130 | 131 |
131 - (void)awakeFromNib { | 132 - (void)awakeFromNib { |
132 [[closeButton_ cell] setImageID:IDR_CLOSE_BAR | 133 [[closeButton_ cell] setImageID:IDR_CLOSE_1 |
133 forButtonState:image_button_cell::kDefaultState]; | 134 forButtonState:image_button_cell::kDefaultState]; |
134 [[closeButton_ cell] setImageID:IDR_CLOSE_BAR_H | 135 [[closeButton_ cell] setImageID:IDR_CLOSE_1_H |
135 forButtonState:image_button_cell::kHoverState]; | 136 forButtonState:image_button_cell::kHoverState]; |
136 [[closeButton_ cell] setImageID:IDR_CLOSE_BAR_P | 137 [[closeButton_ cell] setImageID:IDR_CLOSE_1_P |
137 forButtonState:image_button_cell::kPressedState]; | 138 forButtonState:image_button_cell::kPressedState]; |
138 [[closeButton_ cell] setImageID:IDR_CLOSE_BAR | 139 [[closeButton_ cell] setImageID:IDR_CLOSE_1 |
139 forButtonState:image_button_cell::kDisabledState]; | 140 forButtonState:image_button_cell::kDisabledState]; |
140 | 141 |
141 [findBarView_ setFrame:[self hiddenFindBarFrame]]; | 142 [findBarView_ setFrame:[self hiddenFindBarFrame]]; |
142 defaultWidth_ = NSWidth([findBarView_ frame]); | 143 defaultWidth_ = NSWidth([findBarView_ frame]); |
143 | 144 |
144 [self prepopulateText:[[FindPasteboard sharedInstance] findText]]; | 145 [self prepopulateText:[[FindPasteboard sharedInstance] findText]]; |
145 } | 146 } |
146 | 147 |
147 - (IBAction)close:(id)sender { | 148 - (IBAction)close:(id)sender { |
148 if (findBarBridge_) | 149 if (findBarBridge_) |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 content::WebContents* webContents = tabStripModel->GetWebContentsAt(i); | 646 content::WebContents* webContents = tabStripModel->GetWebContentsAt(i); |
646 if (suppressPboardUpdateActions_ && activeWebContents == webContents) | 647 if (suppressPboardUpdateActions_ && activeWebContents == webContents) |
647 continue; | 648 continue; |
648 FindTabHelper* findTabHelper = | 649 FindTabHelper* findTabHelper = |
649 FindTabHelper::FromWebContents(webContents); | 650 FindTabHelper::FromWebContents(webContents); |
650 findTabHelper->StopFinding(FindBarController::kClearSelectionOnPage); | 651 findTabHelper->StopFinding(FindBarController::kClearSelectionOnPage); |
651 findBarBridge_->ClearResults(findTabHelper->find_result()); | 652 findBarBridge_->ClearResults(findTabHelper->find_result()); |
652 } | 653 } |
653 } | 654 } |
654 @end | 655 @end |
OLD | NEW |