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

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

Issue 244003: Kiosk Mode implementation (Closed)
Patch Set: Finally fix MACOSX Created 11 years, 1 month 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 | « chrome/browser/automation/automation_provider.h ('k') | chrome/browser/browser.h » ('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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/automation/automation_provider.h" 5 #include "chrome/browser/automation/automation_provider.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/message_box_flags.h" 10 #include "app/message_box_flags.h"
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 IPC_MESSAGE_HANDLER(AutomationMsg_Type, GetType) 314 IPC_MESSAGE_HANDLER(AutomationMsg_Type, GetType)
315 IPC_MESSAGE_HANDLER(AutomationMsg_Tab, GetTab) 315 IPC_MESSAGE_HANDLER(AutomationMsg_Tab, GetTab)
316 #if defined(OS_WIN) 316 #if defined(OS_WIN)
317 IPC_MESSAGE_HANDLER(AutomationMsg_TabHWND, GetTabHWND) 317 IPC_MESSAGE_HANDLER(AutomationMsg_TabHWND, GetTabHWND)
318 #endif // defined(OS_WIN) 318 #endif // defined(OS_WIN)
319 IPC_MESSAGE_HANDLER(AutomationMsg_TabProcessID, GetTabProcessID) 319 IPC_MESSAGE_HANDLER(AutomationMsg_TabProcessID, GetTabProcessID)
320 IPC_MESSAGE_HANDLER(AutomationMsg_TabTitle, GetTabTitle) 320 IPC_MESSAGE_HANDLER(AutomationMsg_TabTitle, GetTabTitle)
321 IPC_MESSAGE_HANDLER(AutomationMsg_TabIndex, GetTabIndex) 321 IPC_MESSAGE_HANDLER(AutomationMsg_TabIndex, GetTabIndex)
322 IPC_MESSAGE_HANDLER(AutomationMsg_TabURL, GetTabURL) 322 IPC_MESSAGE_HANDLER(AutomationMsg_TabURL, GetTabURL)
323 IPC_MESSAGE_HANDLER(AutomationMsg_ShelfVisibility, GetShelfVisibility) 323 IPC_MESSAGE_HANDLER(AutomationMsg_ShelfVisibility, GetShelfVisibility)
324 IPC_MESSAGE_HANDLER(AutomationMsg_IsFullscreen, IsFullscreen)
325 IPC_MESSAGE_HANDLER(AutomationMsg_IsFullscreenBubbleVisible,
326 GetFullscreenBubbleVisibility)
324 IPC_MESSAGE_HANDLER(AutomationMsg_HandleUnused, HandleUnused) 327 IPC_MESSAGE_HANDLER(AutomationMsg_HandleUnused, HandleUnused)
325 IPC_MESSAGE_HANDLER(AutomationMsg_ApplyAccelerator, ApplyAccelerator) 328 IPC_MESSAGE_HANDLER(AutomationMsg_ApplyAccelerator, ApplyAccelerator)
326 IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_DomOperation, 329 IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_DomOperation,
327 ExecuteJavascript) 330 ExecuteJavascript)
328 IPC_MESSAGE_HANDLER(AutomationMsg_ConstrainedWindowCount, 331 IPC_MESSAGE_HANDLER(AutomationMsg_ConstrainedWindowCount,
329 GetConstrainedWindowCount) 332 GetConstrainedWindowCount)
330 IPC_MESSAGE_HANDLER(AutomationMsg_FindInPage, HandleFindInPageRequest) 333 IPC_MESSAGE_HANDLER(AutomationMsg_FindInPage, HandleFindInPageRequest)
331 IPC_MESSAGE_HANDLER(AutomationMsg_GetFocusedViewID, GetFocusedViewID) 334 IPC_MESSAGE_HANDLER(AutomationMsg_GetFocusedViewID, GetFocusedViewID)
332 IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_InspectElement, 335 IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_InspectElement,
333 HandleInspectElementRequest) 336 HandleInspectElementRequest)
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 Browser* browser = browser_tracker_->GetResource(handle); 1106 Browser* browser = browser_tracker_->GetResource(handle);
1104 if (browser) { 1107 if (browser) {
1105 if (visible) 1108 if (visible)
1106 browser->window()->GetDownloadShelf()->Show(); 1109 browser->window()->GetDownloadShelf()->Show();
1107 else 1110 else
1108 browser->window()->GetDownloadShelf()->Close(); 1111 browser->window()->GetDownloadShelf()->Close();
1109 } 1112 }
1110 } 1113 }
1111 } 1114 }
1112 1115
1116 void AutomationProvider::IsFullscreen(int handle, bool* visible) {
1117 *visible = false;
1118
1119 if (browser_tracker_->ContainsHandle(handle)) {
1120 Browser* browser = browser_tracker_->GetResource(handle);
1121 if (browser)
1122 *visible = browser->window()->IsFullscreen();
1123 }
1124 }
1125
1126 void AutomationProvider::GetFullscreenBubbleVisibility(int handle,
1127 bool* visible) {
1128 *visible = false;
1129
1130 if (browser_tracker_->ContainsHandle(handle)) {
1131 Browser* browser = browser_tracker_->GetResource(handle);
1132 if (browser)
1133 *visible = browser->window()->IsFullscreenBubbleVisible();
1134 }
1135 }
1113 1136
1114 void AutomationProvider::GetConstrainedWindowCount(int handle, int* count) { 1137 void AutomationProvider::GetConstrainedWindowCount(int handle, int* count) {
1115 *count = -1; // -1 is the error code 1138 *count = -1; // -1 is the error code
1116 if (tab_tracker_->ContainsHandle(handle)) { 1139 if (tab_tracker_->ContainsHandle(handle)) {
1117 NavigationController* nav_controller = tab_tracker_->GetResource(handle); 1140 NavigationController* nav_controller = tab_tracker_->GetResource(handle);
1118 TabContents* tab_contents = nav_controller->tab_contents(); 1141 TabContents* tab_contents = nav_controller->tab_contents();
1119 if (tab_contents) { 1142 if (tab_contents) {
1120 *count = static_cast<int>(tab_contents->child_windows_.size()); 1143 *count = static_cast<int>(tab_contents->child_windows_.size());
1121 } 1144 }
1122 } 1145 }
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
2183 reply_message); 2206 reply_message);
2184 2207
2185 profile_->GetExtensionsService()->LoadExtension(extension_dir); 2208 profile_->GetExtensionsService()->LoadExtension(extension_dir);
2186 profile_->GetUserScriptMaster()->AddWatchedPath(extension_dir); 2209 profile_->GetUserScriptMaster()->AddWatchedPath(extension_dir);
2187 } else { 2210 } else {
2188 AutomationMsg_LoadExpandedExtension::WriteReplyParams( 2211 AutomationMsg_LoadExpandedExtension::WriteReplyParams(
2189 reply_message, AUTOMATION_MSG_EXTENSION_INSTALL_FAILED); 2212 reply_message, AUTOMATION_MSG_EXTENSION_INSTALL_FAILED);
2190 Send(reply_message); 2213 Send(reply_message);
2191 } 2214 }
2192 } 2215 }
OLDNEW
« no previous file with comments | « chrome/browser/automation/automation_provider.h ('k') | chrome/browser/browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698