OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 var chrome; | 5 var chrome; |
6 if (!chrome) | 6 if (!chrome) |
7 chrome = {}; | 7 chrome = {}; |
8 | 8 |
9 if (!chrome.embeddedSearch) { | 9 if (!chrome.embeddedSearch) { |
10 chrome.embeddedSearch = new function() { | 10 chrome.embeddedSearch = new function() { |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 this.newTabPage = new function() { | 86 this.newTabPage = new function() { |
87 | 87 |
88 // ======================================================================= | 88 // ======================================================================= |
89 // Private functions | 89 // Private functions |
90 // ======================================================================= | 90 // ======================================================================= |
91 native function CheckIsUserSignedInToChromeAs(); | 91 native function CheckIsUserSignedInToChromeAs(); |
92 native function CheckIsUserSyncingHistory(); | 92 native function CheckIsUserSyncingHistory(); |
93 native function DeleteMostVisitedItem(); | 93 native function DeleteMostVisitedItem(); |
94 native function GetAppLauncherEnabled(); | 94 native function GetAppLauncherEnabled(); |
95 native function GetDispositionFromClick(); | |
96 native function GetMostVisitedItems(); | 95 native function GetMostVisitedItems(); |
97 native function GetThemeBackgroundInfo(); | 96 native function GetThemeBackgroundInfo(); |
98 native function IsInputInProgress(); | 97 native function IsInputInProgress(); |
99 native function LogEvent(); | 98 native function LogEvent(); |
100 native function LogMostVisitedImpression(); | 99 native function LogMostVisitedImpression(); |
101 native function LogMostVisitedNavigation(); | 100 native function LogMostVisitedNavigation(); |
102 native function NavigateContentWindow(); | |
103 native function UndoAllMostVisitedDeletions(); | 101 native function UndoAllMostVisitedDeletions(); |
104 native function UndoMostVisitedDeletion(); | 102 native function UndoMostVisitedDeletion(); |
105 | 103 |
106 function GetMostVisitedItemsWrapper() { | 104 function GetMostVisitedItemsWrapper() { |
107 var mostVisitedItems = GetMostVisitedItems(); | 105 var mostVisitedItems = GetMostVisitedItems(); |
108 for (var i = 0, item; item = mostVisitedItems[i]; ++i) { | 106 for (var i = 0, item; item = mostVisitedItems[i]; ++i) { |
109 item.faviconUrl = GenerateFaviconURL(item.renderViewId, item.rid); | 107 item.faviconUrl = GenerateFaviconURL(item.renderViewId, item.rid); |
110 | 108 |
111 // These properties are private data and should not be returned to | 109 // These properties are private data and should not be returned to |
112 // the page. They are only accessible via getMostVisitedItemData(). | 110 // the page. They are only accessible via getMostVisitedItemData(). |
(...skipping 19 matching lines...) Expand all Loading... |
132 // ======================================================================= | 130 // ======================================================================= |
133 this.__defineGetter__('appLauncherEnabled', GetAppLauncherEnabled); | 131 this.__defineGetter__('appLauncherEnabled', GetAppLauncherEnabled); |
134 this.__defineGetter__('isInputInProgress', IsInputInProgress); | 132 this.__defineGetter__('isInputInProgress', IsInputInProgress); |
135 this.__defineGetter__('mostVisited', GetMostVisitedItemsWrapper); | 133 this.__defineGetter__('mostVisited', GetMostVisitedItemsWrapper); |
136 this.__defineGetter__('themeBackgroundInfo', GetThemeBackgroundInfo); | 134 this.__defineGetter__('themeBackgroundInfo', GetThemeBackgroundInfo); |
137 | 135 |
138 this.deleteMostVisitedItem = function(restrictedId) { | 136 this.deleteMostVisitedItem = function(restrictedId) { |
139 DeleteMostVisitedItem(restrictedId); | 137 DeleteMostVisitedItem(restrictedId); |
140 }; | 138 }; |
141 | 139 |
142 this.getDispositionFromClick = function(middle_button, | |
143 alt_key, | |
144 ctrl_key, | |
145 meta_key, | |
146 shift_key) { | |
147 return GetDispositionFromClick(middle_button, | |
148 alt_key, | |
149 ctrl_key, | |
150 meta_key, | |
151 shift_key); | |
152 }; | |
153 | |
154 this.checkIsUserSignedIntoChromeAs = function(identity) { | 140 this.checkIsUserSignedIntoChromeAs = function(identity) { |
155 CheckIsUserSignedInToChromeAs(identity); | 141 CheckIsUserSignedInToChromeAs(identity); |
156 }; | 142 }; |
157 | 143 |
158 this.checkIsUserSyncingHistory = function() { | 144 this.checkIsUserSyncingHistory = function() { |
159 CheckIsUserSyncingHistory(); | 145 CheckIsUserSyncingHistory(); |
160 }; | 146 }; |
161 | 147 |
162 // This method is restricted to chrome-search://most-visited pages by | 148 // This method is restricted to chrome-search://most-visited pages by |
163 // checking the invoking context's origin in searchbox_extension.cc. | 149 // checking the invoking context's origin in searchbox_extension.cc. |
164 this.logEvent = function(histogram_name) { | 150 this.logEvent = function(histogram_name) { |
165 LogEvent(histogram_name); | 151 LogEvent(histogram_name); |
166 }; | 152 }; |
167 | 153 |
168 // This method is restricted to chrome-search://most-visited pages by | 154 // This method is restricted to chrome-search://most-visited pages by |
169 // checking the invoking context's origin in searchbox_extension.cc. | 155 // checking the invoking context's origin in searchbox_extension.cc. |
170 this.logMostVisitedImpression = function(position, provider) { | 156 this.logMostVisitedImpression = function(position, provider) { |
171 LogMostVisitedImpression(position, provider); | 157 LogMostVisitedImpression(position, provider); |
172 }; | 158 }; |
173 | 159 |
174 // This method is restricted to chrome-search://most-visited pages by | 160 // This method is restricted to chrome-search://most-visited pages by |
175 // checking the invoking context's origin in searchbox_extension.cc. | 161 // checking the invoking context's origin in searchbox_extension.cc. |
176 this.logMostVisitedNavigation = function(position, provider) { | 162 this.logMostVisitedNavigation = function(position, provider) { |
177 LogMostVisitedNavigation(position, provider); | 163 LogMostVisitedNavigation(position, provider); |
178 }; | 164 }; |
179 | 165 |
180 this.navigateContentWindow = function(rid, disposition) { | |
181 NavigateContentWindow(rid, disposition); | |
182 }; | |
183 | |
184 this.undoAllMostVisitedDeletions = function() { | 166 this.undoAllMostVisitedDeletions = function() { |
185 UndoAllMostVisitedDeletions(); | 167 UndoAllMostVisitedDeletions(); |
186 }; | 168 }; |
187 | 169 |
188 this.undoMostVisitedDeletion = function(restrictedId) { | 170 this.undoMostVisitedDeletion = function(restrictedId) { |
189 UndoMostVisitedDeletion(restrictedId); | 171 UndoMostVisitedDeletion(restrictedId); |
190 }; | 172 }; |
191 | 173 |
192 this.onsignedincheckdone = null; | 174 this.onsignedincheckdone = null; |
193 this.onhistorysynccheckdone = null; | 175 this.onhistorysynccheckdone = null; |
194 this.oninputcancel = null; | 176 this.oninputcancel = null; |
195 this.oninputstart = null; | 177 this.oninputstart = null; |
196 this.onmostvisitedchange = null; | 178 this.onmostvisitedchange = null; |
197 this.onthemechange = null; | 179 this.onthemechange = null; |
198 }; | 180 }; |
199 | 181 |
200 // TODO(jered): Remove when google no longer expects this object. | 182 // TODO(jered): Remove when google no longer expects this object. |
201 chrome.searchBox = this.searchBox; | 183 chrome.searchBox = this.searchBox; |
202 }; | 184 }; |
203 } | 185 } |
OLD | NEW |