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

Side by Side Diff: chrome/browser/browser.cc

Issue 206035: Support the OS X find pasteboard on OS X. (Closed)
Patch Set: foo Created 11 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/cocoa/find_bar_bridge.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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 #include "chrome/browser/browser.h" 5 #include "chrome/browser/browser.h"
6 6
7 #include "app/animation.h" 7 #include "app/animation.h"
8 #include "app/l10n_util.h" 8 #include "app/l10n_util.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/idle_timer.h" 10 #include "base/idle_timer.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 #include "chrome/browser/view_ids.h" 84 #include "chrome/browser/view_ids.h"
85 #include "chrome/browser/views/location_bar_view.h" 85 #include "chrome/browser/views/location_bar_view.h"
86 #include "chrome/browser/views/theme_install_bubble_view.h" 86 #include "chrome/browser/views/theme_install_bubble_view.h"
87 #include "chrome/common/child_process_host.h" 87 #include "chrome/common/child_process_host.h"
88 #endif // OS_WIN 88 #endif // OS_WIN
89 89
90 #if !defined(OS_MACOSX) 90 #if !defined(OS_MACOSX)
91 #include "chrome/browser/dock_info.h" 91 #include "chrome/browser/dock_info.h"
92 #endif 92 #endif
93 93
94 #if defined(OS_MACOSX)
95 #include "chrome/browser/cocoa/find_pasteboard.h"
96 #endif
97
94 using base::TimeDelta; 98 using base::TimeDelta;
95 99
96 // How long we wait before updating the browser chrome while loading a page. 100 // How long we wait before updating the browser chrome while loading a page.
97 static const int kUIUpdateCoalescingTimeMS = 200; 101 static const int kUIUpdateCoalescingTimeMS = 200;
98 102
99 // Idle time before helping prune memory consumption. 103 // Idle time before helping prune memory consumption.
100 static const int kBrowserReleaseMemoryInterval = 30; // In seconds. 104 static const int kBrowserReleaseMemoryInterval = 30; // In seconds.
101 105
102 /////////////////////////////////////////////////////////////////////////////// 106 ///////////////////////////////////////////////////////////////////////////////
103 107
(...skipping 2776 matching lines...) Expand 10 before | Expand all | Expand 10 after
2880 WideToUTF8(profile_->GetPrefs()->GetString(prefs::kHomePage)), 2884 WideToUTF8(profile_->GetPrefs()->GetString(prefs::kHomePage)),
2881 std::string())); 2885 std::string()));
2882 if (!home_page.is_valid()) 2886 if (!home_page.is_valid())
2883 return GURL(chrome::kChromeUINewTabURL); 2887 return GURL(chrome::kChromeUINewTabURL);
2884 return home_page; 2888 return home_page;
2885 } 2889 }
2886 2890
2887 void Browser::FindInPage(bool find_next, bool forward_direction) { 2891 void Browser::FindInPage(bool find_next, bool forward_direction) {
2888 ShowFindBar(); 2892 ShowFindBar();
2889 if (find_next) { 2893 if (find_next) {
2890 GetSelectedTabContents()->StartFinding(string16(), 2894 string16 find_text;
2895 #if defined(OS_MACOSX)
2896 // We always want to search for the contents of the find pasteboard on OS X.
2897 find_text = GetFindPboardText();
2898 #endif
2899 GetSelectedTabContents()->StartFinding(find_text,
2891 forward_direction, 2900 forward_direction,
2892 false); // Not case sensitive. 2901 false); // Not case sensitive.
2893 } 2902 }
2894 } 2903 }
2895 2904
2896 void Browser::CloseFrame() { 2905 void Browser::CloseFrame() {
2897 window_->Close(); 2906 window_->Close();
2898 } 2907 }
2899 2908
2900 // static 2909 // static
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
2932 /////////////////////////////////////////////////////////////////////////////// 2941 ///////////////////////////////////////////////////////////////////////////////
2933 // BrowserToolbarModel (private): 2942 // BrowserToolbarModel (private):
2934 2943
2935 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { 2944 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() {
2936 // This |current_tab| can be NULL during the initialization of the 2945 // This |current_tab| can be NULL during the initialization of the
2937 // toolbar during window creation (i.e. before any tabs have been added 2946 // toolbar during window creation (i.e. before any tabs have been added
2938 // to the window). 2947 // to the window).
2939 TabContents* current_tab = browser_->GetSelectedTabContents(); 2948 TabContents* current_tab = browser_->GetSelectedTabContents();
2940 return current_tab ? &current_tab->controller() : NULL; 2949 return current_tab ? &current_tab->controller() : NULL;
2941 } 2950 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/cocoa/find_bar_bridge.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698